var mt = Object.defineProperty;
var Ct = (r, i, n) => i in r ? mt(r, i, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[i] = n;
var ht = (r, i, n) => (Ct(r, typeof i != "symbol" ? i + "" : i, n), n);
function typeOf(r, i) {
  let n = Object.prototype.toString.call(r).split(" ")[1].slice(0, -1).toLowerCase();
  return i == null ? n : i instanceof Array ? i.includes(n) : n == i;
}
function unshake(r = 200) {
  let i = !0;
  return (n) => {
    i && (n && n(), i = !1, setTimeout(() => {
      i = !0;
    }, r));
  };
}
function clientDownFile(r, i) {
  const n = URL.createObjectURL(i), d = document.createElement("a");
  d.href = n, d.download = r, document.body.appendChild(d), d.click(), document.body.removeChild(d), URL.revokeObjectURL(n);
}
function fileType(r, i) {
  const n = r.substring(r.lastIndexOf(".") + 1, r.length).toLowerCase();
  return i.indexOf(n) >= 0;
}
function arrayToTree(r, { id: i = "id", pid: n = "pid", children: d = "children", rootId: S = null } = {}) {
  const a = r;
  return a.forEach((k) => {
    var P = a.findIndex((L) => L[i] === k[n]);
    P !== -1 && (a[P][d] = a[P][d] || [], a[P][d].push(k));
  }), a.filter((k) => k[n] === S);
}
function downloadByUrl(r, i) {
  const n = new window.XMLHttpRequest();
  n.open("GET", r, !0), n.responseType = "blob", n.onload = () => {
    const d = window.URL.createObjectURL(n.response), S = document.createElement("a");
    S.href = d, S.setAttribute("download", i), S.setAttribute("target", "_blank"), S.style.display = "none", document.body.appendChild(S), setTimeout(() => {
      S.click(), document.body.removeChild(S);
    }, 50);
  }, n.send();
}
function downloadByBlod(r, i, n = "vnd.ms-excel") {
  let d = new Blob([i], {
    type: `application/${n};charset=utf-8`
  }), S = new FileReader();
  S.readAsDataURL(d), S.onload = function(a) {
    var P;
    let k = document.createElement("a");
    k.download = r, k.href = (P = a.target) == null ? void 0 : P.result, document.body.appendChild(k), k.click(), document.body.removeChild(k);
  };
}
function hideCharacter(r, i = "phone") {
  if (typeof r != "string" && typeof r != "number")
    return "";
  if (i === "phone")
    return r.substring(0, 3) + "****" + r.substring(r.length - 4);
  if (i === "email" && String(r).indexOf("@") > 0) {
    let n = r.split("@"), d = "";
    if (n[0].length > 3)
      for (let S = 0; S < n[0].length - 3; S++)
        d += "*";
    return n[0].substring(0, 1) + d + "@" + n[1];
  }
  return "";
}
function urlQuery(r) {
  const i = decodeURIComponent(r.split("?")[1]).replace(/\+/g, " ");
  if (!i)
    return {};
  const n = {};
  return i.split("&").forEach((S) => {
    const a = S.indexOf("=");
    if (a !== -1) {
      const k = S.substring(0, a), P = S.substring(a + 1, S.length);
      n[k] = P;
    }
  }), n;
}
function deepMerge(r, i) {
  let n;
  for (n in i)
    r[n] = r[n] && r[n].toString() === "[object Object]" ? deepMerge(r[n], i[n]) : r[n] = i[n];
  return r;
}
function firstToUpper1(r) {
  return r.trim().toLowerCase().replace(r[0], r[0].toUpperCase());
}
const tools = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  typeOf,
  unshake,
  clientDownFile,
  fileType,
  arrayToTree,
  downloadByUrl,
  downloadByBlod,
  hideCharacter,
  urlQuery,
  deepMerge,
  firstToUpper1
}, Symbol.toStringTag, { value: "Module" }));
function passwordV1(r) {
  return [
    new RegExp(
      "(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9]).{8,30}"
    ).test(r),
    "\u5BC6\u7801\u4E2D\u5FC5\u987B\u5305\u542B\u5927\u5C0F\u5199 \u5B57\u6BCD\u3001\u6570\u5B57\u3001\u7279\u79F0\u5B57\u7B26\uFF0C\u81F3\u5C118\u4E2A\u5B57\u7B26\uFF0C\u6700\u591A30\u4E2A\u5B57\u7B26"
  ];
}
function passwordV2(r) {
  return [
    new RegExp("(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,30}").test(r),
    "\u5BC6\u7801\u4E2D\u5FC5\u987B\u5305\u542B\u5B57\u6BCD\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09\u3001\u6570\u5B57\u3001\u7279\u79F0\u5B57\u7B26\uFF0C\u81F3\u5C118\u4E2A\u5B57\u7B26\uFF0C\u6700\u591A30\u4E2A\u5B57\u7B26"
  ];
}
function passwordV3(r) {
  return [
    new RegExp("(?=.*[0-9])(?=.*[a-zA-Z]).{8,30}").test(r),
    "\u5BC6\u7801\u4E2D\u5FC5\u987B\u5305\u542B\u5B57\u6BCD\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09\u3001\u6570\u5B57\uFF0C\u81F3\u5C118\u4E2A\u5B57\u7B26\uFF0C\u6700\u591A30\u4E2A\u5B57\u7B26"
  ];
}
function passwordV4(r) {
  return [/(?=.*\d)(?=.*[a-zA-Z])[^\u4e00-\u9fa5\s]{8,16}$/.test(r), "8-16\u4F4D\u4E14\u81F3\u5C11\u5305\u542B1\u4E2A\u5B57\u6BCD\uFF0C1\u4E2A\u6570\u5B57"];
}
function accountV1(r) {
  return [/^[a-zA-Z][a-zA-Z0-9_]{5,15}$/.test(r), "\u8D26\u53F7\u9700\u57285-15\u4F4D\u4E4B\u95F4\uFF0C\u4EE5\u5B57\u6BCD\u5F00\u5934"];
}
function accountV2(r) {
  return [/^[a-zA-Z0-9_\u4E00-\u9FA5]{2,16}$/.test(r), "\u6635\u79F0\u652F\u63012-16\u4F4D\u82F1\u6587\u3001\u6570\u5B57\u3001\u4E2D\u6587\u4E0E\u4E0B\u5212\u7EBF"];
}
function validatePhone(r) {
  return [/1[3-9]\d{9}$/.test(r), "\u624B\u673A\u53F7\u7801\u683C\u5F0F\u4E0D\u6B63\u786E"];
}
function validateMail(r) {
  return [/^\w+((.\w+)|(-\w+))@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+).[A-Za-z0-9]+$/.test(r), "\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E"];
}
function validateStaffNum(r) {
  return [/Y\d{6}$/.test(r), "\u5458\u5DE5\u5DE5\u53F7\u5FC5\u987B\u4E3A\u5927\u5199\u5B57\u6BCDY+6\u4F4D\u6570\u5B57"];
}
const validate = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  passwordV1,
  passwordV2,
  passwordV3,
  passwordV4,
  accountV1,
  accountV2,
  validatePhone,
  validateMail,
  validateStaffNum
}, Symbol.toStringTag, { value: "Module" })), demoSdk = {
  alert: function() {
    alert("\u6D4B\u8BD5demo");
  }
};
window.onload = () => {
  window.demoSdk = demoSdk;
};
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
  if (!getRandomValues && (getRandomValues = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !getRandomValues))
    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
  return getRandomValues(rnds8);
}
const byteToHex = [];
for (let r = 0; r < 256; ++r)
  byteToHex.push((r + 256).toString(16).slice(1));
function unsafeStringify(r, i = 0) {
  return (byteToHex[r[i + 0]] + byteToHex[r[i + 1]] + byteToHex[r[i + 2]] + byteToHex[r[i + 3]] + "-" + byteToHex[r[i + 4]] + byteToHex[r[i + 5]] + "-" + byteToHex[r[i + 6]] + byteToHex[r[i + 7]] + "-" + byteToHex[r[i + 8]] + byteToHex[r[i + 9]] + "-" + byteToHex[r[i + 10]] + byteToHex[r[i + 11]] + byteToHex[r[i + 12]] + byteToHex[r[i + 13]] + byteToHex[r[i + 14]] + byteToHex[r[i + 15]]).toLowerCase();
}
const randomUUID = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), native = {
  randomUUID
};
function v4(r, i, n) {
  if (native.randomUUID && !i && !r)
    return native.randomUUID();
  r = r || {};
  const d = r.random || (r.rng || rng)();
  if (d[6] = d[6] & 15 | 64, d[8] = d[8] & 63 | 128, i) {
    n = n || 0;
    for (let S = 0; S < 16; ++S)
      i[n + S] = d[S];
    return i;
  }
  return unsafeStringify(d);
}
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function getDefaultExportFromCjs(r) {
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var cosJsSdkV5 = { exports: {} };
(function(module, exports) {
  (function(i, n) {
    module.exports = n();
  })(commonjsGlobal, function() {
    return function(r) {
      var i = {};
      function n(d) {
        if (i[d])
          return i[d].exports;
        var S = i[d] = {
          i: d,
          l: !1,
          exports: {}
        };
        return r[d].call(S.exports, S, S.exports, n), S.l = !0, S.exports;
      }
      return n.m = r, n.c = i, n.d = function(d, S, a) {
        n.o(d, S) || Object.defineProperty(d, S, { enumerable: !0, get: a });
      }, n.r = function(d) {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(d, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(d, "__esModule", { value: !0 });
      }, n.t = function(d, S) {
        if (S & 1 && (d = n(d)), S & 8 || S & 4 && typeof d == "object" && d && d.__esModule)
          return d;
        var a = /* @__PURE__ */ Object.create(null);
        if (n.r(a), Object.defineProperty(a, "default", { enumerable: !0, value: d }), S & 2 && typeof d != "string")
          for (var k in d)
            n.d(a, k, function(P) {
              return d[P];
            }.bind(null, k));
        return a;
      }, n.n = function(d) {
        var S = d && d.__esModule ? function() {
          return d.default;
        } : function() {
          return d;
        };
        return n.d(S, "a", S), S;
      }, n.o = function(d, S) {
        return Object.prototype.hasOwnProperty.call(d, S);
      }, n.p = "/dist/", n(n.s = "./index.js");
    }({
      "./index.js": function(r, i, n) {
        var d = n("./src/cos.js");
        r.exports = d;
      },
      "./lib/beacon.min.js": function(r, i, n) {
        var d, S, a = n("./node_modules/@babel/runtime/helpers/typeof.js");
        (function(k, P) {
          a(i) == "object" && typeof r < "u" ? r.exports = P() : (d = P, S = typeof d == "function" ? d.call(i, n, i, r) : d, S !== void 0 && (r.exports = S));
        })(this, function() {
          var k = function(o, c) {
            return k = Object.setPrototypeOf || {
              __proto__: []
            } instanceof Array && function(u, v) {
              u.__proto__ = v;
            } || function(u, v) {
              for (var R in v)
                Object.prototype.hasOwnProperty.call(v, R) && (u[R] = v[R]);
            }, k(o, c);
          }, P = function() {
            return P = Object.assign || function(o) {
              for (var c, u = 1, v = arguments.length; u < v; u++)
                for (var R in c = arguments[u])
                  Object.prototype.hasOwnProperty.call(c, R) && (o[R] = c[R]);
              return o;
            }, P.apply(this, arguments);
          };
          function L(g, o, c, u) {
            return new (c || (c = Promise))(function(v, R) {
              function I(ye) {
                try {
                  ge(u.next(ye));
                } catch (te) {
                  R(te);
                }
              }
              function Z(ye) {
                try {
                  ge(u.throw(ye));
                } catch (te) {
                  R(te);
                }
              }
              function ge(ye) {
                var te;
                ye.done ? v(ye.value) : (te = ye.value, te instanceof c ? te : new c(function(De) {
                  De(te);
                })).then(I, Z);
              }
              ge((u = u.apply(g, o || [])).next());
            });
          }
          function A(g, o) {
            var c, u, v, R, I = {
              label: 0,
              sent: function() {
                if (1 & v[0])
                  throw v[1];
                return v[1];
              },
              trys: [],
              ops: []
            };
            return R = {
              next: Z(0),
              throw: Z(1),
              return: Z(2)
            }, typeof Symbol == "function" && (R[Symbol.iterator] = function() {
              return this;
            }), R;
            function Z(ge) {
              return function(ye) {
                return function(te) {
                  if (c)
                    throw new TypeError("Generator is already executing.");
                  for (; I; )
                    try {
                      if (c = 1, u && (v = 2 & te[0] ? u.return : te[0] ? u.throw || ((v = u.return) && v.call(u), 0) : u.next) && !(v = v.call(u, te[1])).done)
                        return v;
                      switch (u = 0, v && (te = [2 & te[0], v.value]), te[0]) {
                        case 0:
                        case 1:
                          v = te;
                          break;
                        case 4:
                          return I.label++, {
                            value: te[1],
                            done: !1
                          };
                        case 5:
                          I.label++, u = te[1], te = [0];
                          continue;
                        case 7:
                          te = I.ops.pop(), I.trys.pop();
                          continue;
                        default:
                          if (v = I.trys, !((v = v.length > 0 && v[v.length - 1]) || te[0] !== 6 && te[0] !== 2)) {
                            I = 0;
                            continue;
                          }
                          if (te[0] === 3 && (!v || te[1] > v[0] && te[1] < v[3])) {
                            I.label = te[1];
                            break;
                          }
                          if (te[0] === 6 && I.label < v[1]) {
                            I.label = v[1], v = te;
                            break;
                          }
                          if (v && I.label < v[2]) {
                            I.label = v[2], I.ops.push(te);
                            break;
                          }
                          v[2] && I.ops.pop(), I.trys.pop();
                          continue;
                      }
                      te = o.call(g, I);
                    } catch (De) {
                      te = [6, De], u = 0;
                    } finally {
                      c = v = 0;
                    }
                  if (5 & te[0])
                    throw te[1];
                  return {
                    value: te[0] ? te[1] : void 0,
                    done: !0
                  };
                }([ge, ye]);
              };
            }
          }
          var B = "__BEACON_", H = "__BEACON_deviceId", G = "last_report_time", X = "sending_event_ids", N = "beacon_config", F = "beacon_config_request_time", ne = function() {
            function g() {
              var o = this;
              this.emit = function(c, u) {
                if (o) {
                  var v, R = o.__EventsList[c];
                  if (R != null && R.length) {
                    R = R.slice();
                    for (var I = 0; I < R.length; I++) {
                      v = R[I];
                      try {
                        var Z = v.callback.apply(o, [u]);
                        if (v.type === 1 && o.remove(c, v.callback), Z === !1)
                          break;
                      } catch (ge) {
                        throw ge;
                      }
                    }
                  }
                  return o;
                }
              }, this.__EventsList = {};
            }
            return g.prototype.indexOf = function(o, c) {
              for (var u = 0; u < o.length; u++)
                if (o[u].callback === c)
                  return u;
              return -1;
            }, g.prototype.on = function(o, c, u) {
              if (u === void 0 && (u = 0), this) {
                var v = this.__EventsList[o];
                if (v || (v = this.__EventsList[o] = []), this.indexOf(v, c) === -1) {
                  var R = {
                    name: o,
                    type: u || 0,
                    callback: c
                  };
                  return v.push(R), this;
                }
                return this;
              }
            }, g.prototype.one = function(o, c) {
              this.on(o, c, 1);
            }, g.prototype.remove = function(o, c) {
              if (this) {
                var u = this.__EventsList[o];
                if (!u)
                  return null;
                if (!c) {
                  try {
                    delete this.__EventsList[o];
                  } catch {
                  }
                  return null;
                }
                if (u.length) {
                  var v = this.indexOf(u, c);
                  u.splice(v, 1);
                }
                return this;
              }
            }, g;
          }();
          function W(g, o) {
            for (var c = {}, u = 0, v = Object.keys(g); u < v.length; u++) {
              var R = v[u], I = g[R];
              if (typeof I == "string")
                c[he(R)] = he(I);
              else {
                if (o)
                  throw new Error("value mast be string  !!!!");
                c[he(String(R))] = he(String(I));
              }
            }
            return c;
          }
          function he(g) {
            if (typeof g != "string")
              return g;
            try {
              return g.replace(new RegExp("\\|", "g"), "%7C").replace(new RegExp("\\&", "g"), "%26").replace(new RegExp("\\=", "g"), "%3D").replace(new RegExp("\\+", "g"), "%2B");
            } catch {
              return "";
            }
          }
          function _(g) {
            return String(g.A99) + String(g.A100);
          }
          var T = function() {
          }, y = function() {
            function g(o) {
              var c = this;
              this.lifeCycle = new ne(), this.uploadJobQueue = [], this.additionalParams = {}, this.delayTime = 0, this._normalLogPipeline = function(u) {
                if (!u || !u.reduce || !u.length)
                  throw new TypeError("createPipeline \u65B9\u6CD5\u9700\u8981\u4F20\u5165\u81F3\u5C11\u6709\u4E00\u4E2A pipe \u7684\u6570\u7EC4");
                return u.length === 1 ? function(v, R) {
                  u[0](v, R || T);
                } : u.reduce(function(v, R) {
                  return function(I, Z) {
                    return Z === void 0 && (Z = T), v(I, function(ge) {
                      return R == null ? void 0 : R(ge, Z);
                    });
                  };
                });
              }([function(u) {
                c.send({
                  url: c.strategy.getUploadUrl(),
                  data: u,
                  method: "post",
                  contentType: "application/json;charset=UTF-8"
                }, function() {
                  var v = c.config.onReportSuccess;
                  typeof v == "function" && v(JSON.stringify(u.events));
                }, function() {
                  var v = c.config.onReportFail;
                  typeof v == "function" && v(JSON.stringify(u.events));
                });
              }]), function(u, v) {
                if (!u)
                  throw v instanceof Error ? v : new Error(v);
              }(Boolean(o.appkey), "appkey must be initial"), this.config = P({}, o);
            }
            return g.prototype.onUserAction = function(o, c) {
              this.preReport(o, c, !1);
            }, g.prototype.onDirectUserAction = function(o, c) {
              this.preReport(o, c, !0);
            }, g.prototype.preReport = function(o, c, u) {
              o ? this.strategy.isEventUpOnOff() && (this.strategy.isBlackEvent(o) || this.strategy.isSampleEvent(o) || this.onReport(o, c, u)) : this.errorReport.reportError("602", " no eventCode");
            }, g.prototype.addAdditionalParams = function(o) {
              for (var c = 0, u = Object.keys(o); c < u.length; c++) {
                var v = u[c];
                this.additionalParams[v] = o[v];
              }
            }, g.prototype.setChannelId = function(o) {
              this.commonInfo.channelID = String(o);
            }, g.prototype.setOpenId = function(o) {
              this.commonInfo.openid = String(o);
            }, g.prototype.setUnionid = function(o) {
              this.commonInfo.unid = String(o);
            }, g.prototype.getDeviceId = function() {
              return this.commonInfo.deviceId;
            }, g.prototype.getCommonInfo = function() {
              return this.commonInfo;
            }, g.prototype.removeSendingId = function(o) {
              try {
                var c = JSON.parse(this.storage.getItem(X)), u = c.indexOf(o);
                u != -1 && (c.splice(u, 1), this.storage.setItem(X, JSON.stringify(c)));
              } catch {
              }
            }, g;
          }(), Q = function() {
            function g(o, c, u, v) {
              this.requestParams = {}, this.network = v, this.requestParams.attaid = "00400014144", this.requestParams.token = "6478159937", this.requestParams.product_id = o.appkey, this.requestParams.platform = u, this.requestParams.uin = c.deviceId, this.requestParams.model = "", this.requestParams.os = u, this.requestParams.app_version = o.appVersion, this.requestParams.sdk_version = c.sdkVersion, this.requestParams.error_stack = "", this.uploadUrl = o.isOversea ? "https://htrace.wetvinfo.com/kv" : "https://h.trace.qq.com/kv";
            }
            return g.prototype.reportError = function(o, c) {
              this.requestParams._dc = Math.random(), this.requestParams.error_msg = c, this.requestParams.error_code = o, this.network.get(this.uploadUrl, {
                params: this.requestParams
              }).catch(function(u) {
              });
            }, g;
          }(), p = function() {
            function g(o, c, u, v, R) {
              this.strategy = {
                isEventUpOnOff: !0,
                httpsUploadUrl: "https://otheve.beacon.qq.com/analytics/v2_upload",
                requestInterval: 30,
                blacklist: [],
                samplelist: []
              }, this.realSample = {}, this.appkey = "", this.needQueryConfig = !0, this.appkey = c.appkey, this.storage = v, this.needQueryConfig = o;
              try {
                var I = JSON.parse(this.storage.getItem(N));
                I && this.processData(I);
              } catch {
              }
              c.isOversea && (this.strategy.httpsUploadUrl = "https://svibeacon.onezapp.com/analytics/v2_upload"), !c.isOversea && this.needRequestConfig() && this.requestConfig(c.appVersion, u, R);
            }
            return g.prototype.requestConfig = function(o, c, u) {
              var v = this;
              this.storage.setItem(F, Date.now().toString()), u.post("https://oth.str.beacon.qq.com/trpc.beacon.configserver.BeaconConfigService/QueryConfig", {
                platformId: typeof wx > "u" ? "3" : "4",
                mainAppKey: this.appkey,
                appVersion: o,
                sdkVersion: c.sdkVersion,
                osVersion: c.userAgent,
                model: "",
                packageName: "",
                params: {
                  A3: c.deviceId
                }
              }).then(function(R) {
                if (R.data.ret == 0)
                  try {
                    var I = JSON.parse(R.data.beaconConfig);
                    I && (v.processData(I), v.storage.setItem(N, R.data.beaconConfig));
                  } catch {
                  }
                else
                  v.processData(null), v.storage.setItem(N, "");
              }).catch(function(R) {
              });
            }, g.prototype.processData = function(o) {
              var c, u, v, R, I;
              this.strategy.isEventUpOnOff = (c = o == null ? void 0 : o.isEventUpOnOff) !== null && c !== void 0 ? c : this.strategy.isEventUpOnOff, this.strategy.httpsUploadUrl = (u = o == null ? void 0 : o.httpsUploadUrl) !== null && u !== void 0 ? u : this.strategy.httpsUploadUrl, this.strategy.requestInterval = (v = o == null ? void 0 : o.requestInterval) !== null && v !== void 0 ? v : this.strategy.requestInterval, this.strategy.blacklist = (R = o == null ? void 0 : o.blacklist) !== null && R !== void 0 ? R : this.strategy.blacklist, this.strategy.samplelist = (I = o == null ? void 0 : o.samplelist) !== null && I !== void 0 ? I : this.strategy.samplelist;
              for (var Z = 0, ge = this.strategy.samplelist; Z < ge.length; Z++) {
                var ye = ge[Z].split(",");
                ye.length == 2 && (this.realSample[ye[0]] = ye[1]);
              }
            }, g.prototype.needRequestConfig = function() {
              if (!this.needQueryConfig)
                return !1;
              var o = Number(this.storage.getItem(F));
              return Date.now() - o > 60 * this.strategy.requestInterval * 1e3;
            }, g.prototype.getUploadUrl = function() {
              return this.strategy.httpsUploadUrl + "?appkey=" + this.appkey;
            }, g.prototype.isBlackEvent = function(o) {
              return this.strategy.blacklist.indexOf(o) != -1;
            }, g.prototype.isEventUpOnOff = function() {
              return this.strategy.isEventUpOnOff;
            }, g.prototype.isSampleEvent = function(o) {
              return !!Object.prototype.hasOwnProperty.call(this.realSample, o) && this.realSample[o] < Math.floor(Math.random() * Math.floor(1e4));
            }, g;
          }(), M = "session_storage_key", j = function() {
            function g(o, c, u) {
              this.getSessionStackDepth = 0, this.beacon = u, this.storage = o, this.duration = c, this.appkey = u.config.appkey;
            }
            return g.prototype.getSession = function() {
              this.getSessionStackDepth += 1;
              var o = this.storage.getItem(M);
              if (!o)
                return this.createSession();
              var c = "", u = 0;
              try {
                var v = JSON.parse(o) || {
                  sessionId: void 0,
                  sessionStart: void 0
                };
                if (!v.sessionId || !v.sessionStart)
                  return this.createSession();
                var R = Number(this.storage.getItem(G));
                if (Date.now() - R > this.duration)
                  return this.createSession();
                c = v.sessionId, u = v.sessionStart, this.getSessionStackDepth = 0;
              } catch {
              }
              return {
                sessionId: c,
                sessionStart: u
              };
            }, g.prototype.createSession = function() {
              var o = Date.now(), c = {
                sessionId: this.appkey + "_" + o.toString(),
                sessionStart: o
              };
              this.storage.setItem(M, JSON.stringify(c)), this.storage.setItem(G, o.toString());
              var u = "is_new_user", v = this.storage.getItem(u);
              return this.getSessionStackDepth <= 1 && this.beacon.onDirectUserAction("rqd_applaunched", {
                A21: v ? "N" : "Y"
              }), this.storage.setItem(u, JSON.stringify(!1)), c;
            }, g;
          }();
          function K() {
            var g = navigator.userAgent, o = g.indexOf("compatible") > -1 && g.indexOf("MSIE") > -1, c = g.indexOf("Edge") > -1 && !o, u = g.indexOf("Trident") > -1 && g.indexOf("rv:11.0") > -1;
            if (o) {
              new RegExp("MSIE (\\d+\\.\\d+);").test(g);
              var v = parseFloat(RegExp.$1);
              return v == 7 ? 7 : v == 8 ? 8 : v == 9 ? 9 : v == 10 ? 10 : 6;
            }
            return c ? -2 : u ? 11 : -1;
          }
          function oe(g, o) {
            var c, u;
            return (c = "https://tun-cos-1258344701.file.myqcloud.com/fp.js", u === void 0 && (u = Date.now() + "-" + Math.random()), new Promise(function(v, R) {
              if (document.getElementById(u))
                v(void 0);
              else {
                var I = document.getElementsByTagName("head")[0], Z = document.createElement("script");
                Z.onload = function() {
                  return function() {
                    Z.onload = null, v(void 0);
                  };
                }, Z.onerror = function(ge) {
                  Z.onerror = null, I.removeChild(Z), R(ge);
                }, Z.src = c, Z.id = u, I.appendChild(Z);
              }
            })).then(function() {
              new Fingerprint().getQimei36(g, o);
            }).catch(function(v) {
            }), "";
          }
          var w = function() {
            return (w = Object.assign || function(o) {
              for (var c, u = 1, v = arguments.length; u < v; u++)
                for (var R in c = arguments[u])
                  Object.prototype.hasOwnProperty.call(c, R) && (o[R] = c[R]);
              return o;
            }).apply(this, arguments);
          }, z, q = function() {
            function g(o, c) {
              c === void 0 && (c = {}), this.reportOptions = {}, this.config = o, this.reportOptions = c;
            }
            return g.canUseDB = function() {
              return !!(window != null && window.indexedDB);
            }, g.prototype.openDB = function() {
              var o = this;
              return new Promise(function(c, u) {
                if (!g.canUseDB())
                  return u({
                    message: "\u5F53\u524D\u4E0D\u652F\u6301 indexeddb"
                  });
                var v = o.config, R = v.name, I = v.version, Z = v.stores, ge = indexedDB.open(R, I);
                ge.onsuccess = function() {
                  o.db = ge.result, c(), w({
                    result: 1,
                    func: "open",
                    params: JSON.stringify(o.config)
                  }, o.reportOptions);
                }, ge.onerror = function(ye) {
                  var te, De;
                  u(ye), w({
                    result: 0,
                    func: "open",
                    params: JSON.stringify(o.config),
                    error_msg: (De = (te = ye.target) === null || te === void 0 ? void 0 : te.error) === null || De === void 0 ? void 0 : De.message
                  }, o.reportOptions);
                }, ge.onupgradeneeded = function() {
                  o.db = ge.result;
                  try {
                    Z == null || Z.forEach(function(ye) {
                      o.createStore(ye);
                    });
                  } catch (ye) {
                    w({
                      result: 0,
                      func: "open",
                      params: JSON.stringify(o.config),
                      error_msg: ye.message
                    }, o.reportOptions), u(ye);
                  }
                };
              });
            }, g.prototype.useStore = function(o) {
              return this.storeName = o, this;
            }, g.prototype.deleteDB = function() {
              var o = this;
              return this.closeDB(), new Promise(function(c, u) {
                var v = indexedDB.deleteDatabase(o.config.name);
                v.onsuccess = function() {
                  return c();
                }, v.onerror = u;
              });
            }, g.prototype.closeDB = function() {
              var o;
              (o = this.db) === null || o === void 0 || o.close(), this.db = null;
            }, g.prototype.getStoreCount = function() {
              var o = this;
              return new Promise(function(c, u) {
                var v = o.getStore("readonly").count();
                v.onsuccess = function() {
                  return c(v.result);
                }, v.onerror = u;
              });
            }, g.prototype.clearStore = function() {
              var o = this;
              return new Promise(function(c, u) {
                var v = o.getStore("readwrite").clear();
                v.onsuccess = function() {
                  return c();
                }, v.onerror = u;
              });
            }, g.prototype.add = function(o, c) {
              var u = this;
              return new Promise(function(v, R) {
                var I = u.getStore("readwrite").add(o, c);
                I.onsuccess = function() {
                  v(I.result);
                }, I.onerror = R;
              });
            }, g.prototype.put = function(o, c) {
              var u = this;
              return new Promise(function(v, R) {
                var I = u.getStore("readwrite").put(o, c);
                I.onsuccess = function() {
                  v(I.result);
                }, I.onerror = R;
              });
            }, g.prototype.getStoreAllData = function() {
              var o = this;
              return new Promise(function(c, u) {
                var v = o.getStore("readonly").openCursor(), R = [];
                v.onsuccess = function() {
                  var I;
                  if (!((I = v.result) === null || I === void 0) && I.value) {
                    var Z = v.result.value;
                    R.push(Z), v.result.continue();
                  } else
                    c(R);
                }, v.onerror = u;
              });
            }, g.prototype.getDataRangeByIndex = function(o, c, u, v, R) {
              var I = this;
              return new Promise(function(Z, ge) {
                var ye = I.getStore().index(o), te = IDBKeyRange.bound(c, u, v, R), De = [], xe = ye.openCursor(te);
                xe.onsuccess = function() {
                  var Ne;
                  !((Ne = xe == null ? void 0 : xe.result) === null || Ne === void 0) && Ne.value ? (De.push(xe == null ? void 0 : xe.result.value), xe == null || xe.result.continue()) : Z(De);
                }, xe.onerror = ge;
              });
            }, g.prototype.removeDataByIndex = function(o, c, u, v, R) {
              var I = this;
              return new Promise(function(Z, ge) {
                var ye = I.getStore("readwrite").index(o), te = IDBKeyRange.bound(c, u, v, R), De = ye.openCursor(te), xe = 0;
                De.onsuccess = function(Ne) {
                  var Fe = Ne.target.result;
                  Fe ? (xe += 1, Fe.delete(), Fe.continue()) : Z(xe);
                }, De.onerror = ge;
              });
            }, g.prototype.createStore = function(o) {
              var c = o.name, u = o.indexes, v = u === void 0 ? [] : u, R = o.options;
              if (this.db) {
                this.db.objectStoreNames.contains(c) && this.db.deleteObjectStore(c);
                var I = this.db.createObjectStore(c, R);
                v.forEach(function(Z) {
                  I.createIndex(Z.indexName, Z.keyPath, Z.options);
                });
              }
            }, g.prototype.getStore = function(o) {
              var c;
              return o === void 0 && (o = "readonly"), (c = this.db) === null || c === void 0 ? void 0 : c.transaction(this.storeName, o).objectStore(this.storeName);
            }, g;
          }(), V = "event_table_v3", Y = "eventId", ie = function() {
            function g(o) {
              this.isReady = !1, this.taskQueue = Promise.resolve(), this.db = new q({
                name: "Beacon_" + o + "_V3",
                version: 1,
                stores: [{
                  name: V,
                  options: {
                    keyPath: Y
                  },
                  indexes: [{
                    indexName: Y,
                    keyPath: Y,
                    options: {
                      unique: !0
                    }
                  }]
                }]
              }), this.open();
            }
            return g.prototype.getCount = function() {
              var o = this;
              return this.readyExec(function() {
                return o.db.getStoreCount();
              });
            }, g.prototype.setItem = function(o, c) {
              var u = this;
              return this.readyExec(function() {
                return u.db.add({
                  eventId: o,
                  value: c
                });
              });
            }, g.prototype.getItem = function(o) {
              return L(this, void 0, void 0, function() {
                var c = this;
                return A(this, function(u) {
                  return [2, this.readyExec(function() {
                    return c.db.getDataRangeByIndex(Y, o, o);
                  })];
                });
              });
            }, g.prototype.removeItem = function(o) {
              var c = this;
              return this.readyExec(function() {
                return c.db.removeDataByIndex(Y, o, o);
              });
            }, g.prototype.updateItem = function(o, c) {
              var u = this;
              return this.readyExec(function() {
                return u.db.put({
                  eventId: o,
                  value: c
                });
              });
            }, g.prototype.iterate = function(o) {
              var c = this;
              return this.readyExec(function() {
                return c.db.getStoreAllData().then(function(u) {
                  u.forEach(function(v) {
                    o(v.value);
                  });
                });
              });
            }, g.prototype.open = function() {
              return L(this, void 0, void 0, function() {
                var o = this;
                return A(this, function(c) {
                  switch (c.label) {
                    case 0:
                      return this.taskQueue = this.taskQueue.then(function() {
                        return o.db.openDB();
                      }), [4, this.taskQueue];
                    case 1:
                      return c.sent(), this.isReady = !0, this.db.useStore(V), [2];
                  }
                });
              });
            }, g.prototype.readyExec = function(o) {
              return this.isReady ? o() : (this.taskQueue = this.taskQueue.then(function() {
                return o();
              }), this.taskQueue);
            }, g;
          }(), le = function() {
            function g(o) {
              this.keyObject = {}, this.storage = o;
            }
            return g.prototype.getCount = function() {
              return this.storage.getStoreCount();
            }, g.prototype.removeItem = function(o) {
              this.storage.removeItem(o), delete this.keyObject[o];
            }, g.prototype.setItem = function(o, c) {
              var u = JSON.stringify(c);
              this.storage.setItem(o, u), this.keyObject[o] = c;
            }, g.prototype.iterate = function(o) {
              for (var c = Object.keys(this.keyObject), u = 0; u < c.length; u++) {
                var v = this.storage.getItem(c[u]);
                o(JSON.parse(v));
              }
            }, g;
          }(), ue = function() {
            function g(o, c) {
              var u = this;
              this.dbEventCount = 0, K() > 0 || !window.indexedDB || /X5Lite/.test(navigator.userAgent) ? (this.store = new le(c), this.dbEventCount = this.store.getCount()) : (this.store = new ie(o), this.getCount().then(function(v) {
                u.dbEventCount = v;
              }).catch(function(v) {
              }));
            }
            return g.prototype.getCount = function() {
              return L(this, void 0, void 0, function() {
                return A(this, function(o) {
                  switch (o.label) {
                    case 0:
                      return o.trys.push([0, 2, , 3]), [4, this.store.getCount()];
                    case 1:
                      return [2, o.sent()];
                    case 2:
                      return o.sent(), [2, Promise.reject()];
                    case 3:
                      return [2];
                  }
                });
              });
            }, g.prototype.insertEvent = function(o, c) {
              return L(this, void 0, void 0, function() {
                var u, v;
                return A(this, function(R) {
                  switch (R.label) {
                    case 0:
                      if (this.dbEventCount >= 1e4)
                        return [2, Promise.reject()];
                      u = _(o.mapValue), R.label = 1;
                    case 1:
                      return R.trys.push([1, 3, , 4]), this.dbEventCount++, [4, this.store.setItem(u, o)];
                    case 2:
                      return [2, R.sent()];
                    case 3:
                      return v = R.sent(), c && c(v, o), this.dbEventCount--, [2, Promise.reject()];
                    case 4:
                      return [2];
                  }
                });
              });
            }, g.prototype.getEvents = function() {
              return L(this, void 0, void 0, function() {
                var o;
                return A(this, function(c) {
                  switch (c.label) {
                    case 0:
                      o = [], c.label = 1;
                    case 1:
                      return c.trys.push([1, 3, , 4]), [4, this.store.iterate(function(u) {
                        o.push(u);
                      })];
                    case 2:
                      return c.sent(), [2, Promise.all(o)];
                    case 3:
                      return c.sent(), [2, Promise.all(o)];
                    case 4:
                      return [2];
                  }
                });
              });
            }, g.prototype.removeEvent = function(o) {
              return L(this, void 0, void 0, function() {
                var c;
                return A(this, function(u) {
                  switch (u.label) {
                    case 0:
                      c = _(o.mapValue), u.label = 1;
                    case 1:
                      return u.trys.push([1, 3, , 4]), this.dbEventCount--, [4, this.store.removeItem(c)];
                    case 2:
                      return [2, u.sent()];
                    case 3:
                      return u.sent(), this.dbEventCount++, [2, Promise.reject()];
                    case 4:
                      return [2];
                  }
                });
              });
            }, g;
          }(), ee = function() {
            return (ee = Object.assign || function(o) {
              for (var c, u = 1, v = arguments.length; u < v; u++)
                for (var R in c = arguments[u])
                  Object.prototype.hasOwnProperty.call(c, R) && (o[R] = c[R]);
              return o;
            }).apply(this, arguments);
          };
          function de(g) {
            try {
              return decodeURIComponent(g.replace(/\+/g, " "));
            } catch {
              return null;
            }
          }
          function ae(g, o) {
            var c = [null, void 0, "", NaN].includes(g);
            if (o.isSkipEmpty && c)
              return null;
            var u = !o.isSkipEmpty && c ? "" : g;
            try {
              return o.encode ? encodeURIComponent(u) : u;
            } catch {
              return null;
            }
          }
          function Ce(g, o) {
            o === void 0 && (o = {
              encode: !0,
              isSkipEmpty: !1
            });
            var c = g.url, u = g.query, v = u === void 0 ? {} : u, R = g.hash, I = c.split("#"), Z = I[0], ge = I[1], ye = ge === void 0 ? "" : ge, te = Z.split("?")[0], De = [], xe = ae(R || ye, o), Ne = ee(ee({}, function(Fe) {
              var Ke = Fe.split("#"), qe = Ke[0], Xe = Ke[1], Ge = Xe === void 0 ? "" : Xe, ze = qe.split("?"), Ve = ze[0], We = ze[1], st = We === void 0 ? "" : We, rt = de(Ge), tt = /* @__PURE__ */ Object.create(null);
              return st.split("&").forEach(function(s) {
                var f = s.split("="), E = f[0], D = f[1], fe = D === void 0 ? "" : D, Be = de(E), Me = de(fe);
                Be === null || Me === null || Be === "" && Me === "" || tt[Be] || (tt[Be] = Me);
              }), {
                url: Ve,
                query: tt,
                hash: rt
              };
            }(c).query), v);
            return Object.keys(Ne).forEach(function(Fe) {
              var Ke = ae(Fe, o), qe = ae(Ne[Fe], o);
              Ke !== null && qe !== null && De.push(Ke + "=" + qe);
            }), te + (De.length ? "?" + De.join("&") : "") + (xe ? "#" + xe : "");
          }
          function J(g, o) {
            return new Promise(function(c, u) {
              if (o && document.querySelectorAll("script[data-tag=" + o + "]").length)
                return c();
              var v = document.createElement("script"), R = ee({
                type: "text/javascript",
                charset: "utf-8"
              }, g);
              Object.keys(R).forEach(function(I) {
                return function(Z, ge, ye) {
                  if (Z)
                    return ye === void 0 ? Z.getAttribute(ge) : Z.setAttribute(ge, ye);
                }(v, I, R[I]);
              }), o && (v.dataset.tag = o), v.onload = function() {
                return c();
              }, v.onreadystatechange = function() {
                var I = v.readyState;
                ["complete", "loaded"].includes(I) && (v.onreadystatechange = null, c());
              }, v.onerror = u, document.body.appendChild(v);
            });
          }
          (function(g) {
            g[g.equal = 0] = "equal", g[g.low = -1] = "low", g[g.high = 1] = "high";
          })(z || (z = {}));
          var re = function() {
            return (re = Object.assign || function(o) {
              for (var c, u = 1, v = arguments.length; u < v; u++)
                for (var R in c = arguments[u])
                  Object.prototype.hasOwnProperty.call(c, R) && (o[R] = c[R]);
              return o;
            }).apply(this, arguments);
          };
          function pe(g, o, c, u) {
            return new (c || (c = Promise))(function(v, R) {
              function I(ye) {
                try {
                  ge(u.next(ye));
                } catch (te) {
                  R(te);
                }
              }
              function Z(ye) {
                try {
                  ge(u.throw(ye));
                } catch (te) {
                  R(te);
                }
              }
              function ge(ye) {
                var te;
                ye.done ? v(ye.value) : (te = ye.value, te instanceof c ? te : new c(function(De) {
                  De(te);
                })).then(I, Z);
              }
              ge((u = u.apply(g, o || [])).next());
            });
          }
          function Se(g, o) {
            var c, u, v, R, I = {
              label: 0,
              sent: function() {
                if (1 & v[0])
                  throw v[1];
                return v[1];
              },
              trys: [],
              ops: []
            };
            return R = {
              next: Z(0),
              throw: Z(1),
              return: Z(2)
            }, typeof Symbol == "function" && (R[Symbol.iterator] = function() {
              return this;
            }), R;
            function Z(ge) {
              return function(ye) {
                return function(te) {
                  if (c)
                    throw new TypeError("Generator is already executing.");
                  for (; I; )
                    try {
                      if (c = 1, u && (v = 2 & te[0] ? u.return : te[0] ? u.throw || ((v = u.return) && v.call(u), 0) : u.next) && !(v = v.call(u, te[1])).done)
                        return v;
                      switch (u = 0, v && (te = [2 & te[0], v.value]), te[0]) {
                        case 0:
                        case 1:
                          v = te;
                          break;
                        case 4:
                          return I.label++, {
                            value: te[1],
                            done: !1
                          };
                        case 5:
                          I.label++, u = te[1], te = [0];
                          continue;
                        case 7:
                          te = I.ops.pop(), I.trys.pop();
                          continue;
                        default:
                          if (!((v = (v = I.trys).length > 0 && v[v.length - 1]) || te[0] !== 6 && te[0] !== 2)) {
                            I = 0;
                            continue;
                          }
                          if (te[0] === 3 && (!v || te[1] > v[0] && te[1] < v[3])) {
                            I.label = te[1];
                            break;
                          }
                          if (te[0] === 6 && I.label < v[1]) {
                            I.label = v[1], v = te;
                            break;
                          }
                          if (v && I.label < v[2]) {
                            I.label = v[2], I.ops.push(te);
                            break;
                          }
                          v[2] && I.ops.pop(), I.trys.pop();
                          continue;
                      }
                      te = o.call(g, I);
                    } catch (De) {
                      te = [6, De], u = 0;
                    } finally {
                      c = v = 0;
                    }
                  if (5 & te[0])
                    throw te[1];
                  return {
                    value: te[0] ? te[1] : void 0,
                    done: !0
                  };
                }([ge, ye]);
              };
            }
          }
          var ve = function() {
            function g() {
              this.interceptors = [];
            }
            return g.prototype.use = function(o, c) {
              return this.interceptors.push({
                resolved: o,
                rejected: c
              }), this.interceptors.length - 1;
            }, g.prototype.traverse = function(o, c) {
              c === void 0 && (c = !1);
              var u = Promise.resolve(o);
              return (c ? Array.prototype.reduceRight : Array.prototype.reduce).call(this.interceptors, function(v, R) {
                if (R) {
                  var I = R.resolved, Z = R.rejected;
                  u = u.then(I, Z);
                }
                return v;
              }, ""), u;
            }, g.prototype.eject = function(o) {
              this.interceptors[o] && (this.interceptors[o] = null);
            }, g;
          }(), me = {
            defaults: {
              timeout: 0,
              method: "GET",
              mode: "cors",
              redirect: "follow",
              credentials: "same-origin"
            },
            headers: {
              common: {
                Accept: "application/json, text/plain, */*"
              },
              POST: {
                "Content-Type": "application/x-www-form-urlencoded"
              },
              PUT: {
                "Content-Type": "application/x-www-form-urlencoded"
              },
              PATCH: {
                "Content-Type": "application/x-www-form-urlencoded"
              }
            },
            baseURL: "",
            polyfillUrl: "https://vm.gtimg.cn/comps/script/fetch.min.js",
            interceptors: {
              request: new ve(),
              response: new ve()
            }
          }, Te = /^([a-z][a-z\d+\-.]*:)?\/\//i, Ee = Object.prototype.toString;
          function be(g) {
            return pe(this, void 0, void 0, function() {
              var o;
              return Se(this, function(c) {
                switch (c.label) {
                  case 0:
                    if (window.fetch)
                      return [2];
                    c.label = 1;
                  case 1:
                    return c.trys.push([1, 3, , 4]), [4, J({
                      src: g
                    })];
                  case 2:
                    return c.sent(), [3, 4];
                  case 3:
                    throw o = c.sent(), new Error("\u52A0\u8F7D polyfill " + g + " \u5931\u8D25: " + o.message);
                  case 4:
                    return [2];
                }
              });
            });
          }
          function Ie(g) {
            return ["Accept", "Content-Type"].forEach(function(o) {
              return c = o, void ((u = g.headers) && Object.keys(u).forEach(function(v) {
                v !== c && v.toUpperCase() === c.toUpperCase() && (u[c] = u[v], delete u[v]);
              }));
              var c, u;
            }), function(o) {
              if (Ee.call(o) !== "[object Object]")
                return !1;
              var c = Object.getPrototypeOf(o);
              return c === null || c === Object.prototype;
            }(g.body) && (g.body = JSON.stringify(g.body), g.headers && (g.headers["Content-Type"] = "application/json;charset=utf-8")), g;
          }
          function Ae(g) {
            return pe(this, void 0, void 0, function() {
              var o, c, u, v, R, I, Z, ge, ye, te, De, xe, Ne, Fe, Ke, qe, Xe;
              return Se(this, function(Ge) {
                switch (Ge.label) {
                  case 0:
                    return o = me.baseURL, c = me.defaults, u = me.interceptors, [4, be(me.polyfillUrl)];
                  case 1:
                    return Ge.sent(), (v = re(re({}, c), g)).headers || (v.headers = function(ze) {
                      ze === void 0 && (ze = "GET");
                      var Ve = me.headers[ze] || {};
                      return re(re({}, me.headers.common), Ve);
                    }(v.method)), Ie(v), [4, u.request.traverse(v, !0)];
                  case 2:
                    if ((R = Ge.sent()) instanceof Error)
                      throw R;
                    return R.url = function(ze, Ve) {
                      return !ze || Te.test(Ve) ? Ve : ze.replace(/\/+$/, "") + "/" + Ve.replace(/^\/+/, "");
                    }(o, R.url), I = R.url, Z = R.timeout, ge = R.params, ye = R.method, te = ["GET", "DELETE", "OPTIONS", "HEAD"].includes(ye === void 0 ? "GET" : ye) && !!ge, De = te ? Ce({
                      url: I,
                      query: ge
                    }) : I, xe = [], Z && !R.signal && (Ke = new Promise(function(ze) {
                      Ne = setTimeout(function() {
                        ze(new Error("timeout"));
                      }, Z);
                    }), xe.push(Ke), Fe = new AbortController(), R.signal = Fe.signal), xe.push(fetch(De, R).catch(function(ze) {
                      return ze;
                    })), [4, Promise.race(xe)];
                  case 3:
                    return qe = Ge.sent(), Ne && clearTimeout(Ne), [4, u.response.traverse(qe)];
                  case 4:
                    if ((Xe = Ge.sent()) instanceof Error)
                      throw Fe == null || Fe.abort(), Xe;
                    return [2, Xe];
                }
              });
            });
          }
          var Oe = function() {
            function g(o) {
              me.interceptors.request.use(function(c) {
                var u = c.url, v = c.method, R = c.body, I = R;
                if (o.onReportBeforeSend) {
                  var Z = o.onReportBeforeSend({
                    url: u,
                    method: v,
                    data: R ? JSON.parse(R) : null
                  });
                  I = Z != null && Z.data ? JSON.stringify(Z.data) : null;
                }
                return v != "GET" && I ? P(P({}, c), {
                  body: I
                }) : c;
              });
            }
            return g.prototype.get = function(o, c) {
              return L(this, void 0, void 0, function() {
                var u, v;
                return A(this, function(R) {
                  switch (R.label) {
                    case 0:
                      return [4, Ae(P({
                        url: o
                      }, c))];
                    case 1:
                      return [4, (u = R.sent()).json()];
                    case 2:
                      return v = R.sent(), [2, Promise.resolve({
                        data: v,
                        status: u.status,
                        statusText: u.statusText,
                        headers: u.headers
                      })];
                  }
                });
              });
            }, g.prototype.post = function(o, c, u) {
              return L(this, void 0, void 0, function() {
                var v, R;
                return A(this, function(I) {
                  switch (I.label) {
                    case 0:
                      return [4, Ae(P({
                        url: o,
                        body: c,
                        method: "POST"
                      }, u))];
                    case 1:
                      return [4, (v = I.sent()).json()];
                    case 2:
                      return R = I.sent(), [2, Promise.resolve({
                        data: R,
                        status: v.status,
                        statusText: v.statusText,
                        headers: v.headers
                      })];
                  }
                });
              });
            }, g;
          }(), se = function() {
            function g(o) {
              this.appkey = o;
            }
            return g.prototype.getItem = function(o) {
              try {
                return window.localStorage.getItem(this.getStoreKey(o));
              } catch {
                return "";
              }
            }, g.prototype.removeItem = function(o) {
              try {
                window.localStorage.removeItem(this.getStoreKey(o));
              } catch {
              }
            }, g.prototype.setItem = function(o, c) {
              try {
                window.localStorage.setItem(this.getStoreKey(o), c);
              } catch {
              }
            }, g.prototype.setSessionItem = function(o, c) {
              try {
                window.sessionStorage.setItem(this.getStoreKey(o), c);
              } catch {
              }
            }, g.prototype.getSessionItem = function(o) {
              try {
                return window.sessionStorage.getItem(this.getStoreKey(o));
              } catch {
                return "";
              }
            }, g.prototype.getStoreKey = function(o) {
              return B + this.appkey + "_" + o;
            }, g.prototype.createDeviceId = function() {
              try {
                var o = window.localStorage.getItem(H);
                return o || (o = function(c) {
                  for (var u = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789", v = "", R = 0; R < c; R++)
                    v += u.charAt(Math.floor(Math.random() * u.length));
                  return v;
                }(32), window.localStorage.setItem(H, o)), o;
              } catch {
                return "";
              }
            }, g.prototype.clear = function() {
              try {
                for (var o = window.localStorage.length, c = 0; c < o; c++) {
                  var u = window.localStorage.key(c);
                  (u == null ? void 0 : u.substr(0, 9)) == B && window.localStorage.removeItem(u);
                }
              } catch {
              }
            }, g.prototype.getStoreCount = function() {
              var o = 0;
              try {
                o = window.localStorage.length;
              } catch {
              }
              return o;
            }, g;
          }(), b = "logid_start", U = "4.5.14-web";
          return function(g) {
            function o(c) {
              var u = g.call(this, c) || this;
              u.qimei36 = "", u.uselessCycleTaskNum = 0, u.underWeakNet = !1, u.pauseSearching = !1, u.send = function(Z, ge, ye) {
                u.storage.setItem(G, Date.now().toString()), u.network.post(u.uploadUrl || u.strategy.getUploadUrl(), Z.data).then(function(te) {
                  var De;
                  ((De = te == null ? void 0 : te.data) === null || De === void 0 ? void 0 : De.result) == 100 ? u.delayTime = 1e3 * te.data.delayTime : u.delayTime = 0, ge && ge(Z.data), Z.data.events.forEach(function(xe) {
                    u.store.removeEvent(xe).then(function() {
                      u.removeSendingId(_(xe.mapValue));
                    });
                  }), u.doCustomCycleTask();
                }).catch(function(te) {
                  var De = Z.data.events;
                  u.errorReport.reportError(te.code ? te.code.toString() : "600", te.message), ye && ye(Z.data);
                  var xe = JSON.parse(u.storage.getItem(X));
                  De.forEach(function(Ne) {
                    xe && xe.indexOf(_(Ne)) != -1 && u.store.insertEvent(Ne, function(Fe, Ke) {
                      Fe && u.errorReport.reportError("604", "insertEvent fail!");
                    }), u.removeSendingId(_(Ne));
                  }), u.monitorUploadFailed();
                });
              };
              var v, R, I = K();
              return u.isUnderIE8 = I > 0 && I < 8, u.isUnderIE8 || (u.isUnderIE = I > 0, c.needInitQimei && oe(c.appkey, function(Z) {
                u.qimei36 = Z.q36;
              }), u.network = new Oe(c), u.storage = new se(c.appkey), u.initCommonInfo(c), u.store = new ue(c.appkey, u.storage), u.errorReport = new Q(u.config, u.commonInfo, "web", u.network), u.strategy = new p(c.needQueryConfig == null || c.needQueryConfig, u.config, u.commonInfo, u.storage, u.network), u.logidStartTime = u.storage.getItem(b), u.logidStartTime || (u.logidStartTime = Date.now().toString(), u.storage.setItem(b, u.logidStartTime)), v = u.logidStartTime, R = Date.now() - Number.parseFloat(v), Math.floor(R / 864e5) >= 365 && u.storage.clear(), u.initSession(c), u.onDirectUserAction("rqd_js_init", {}), setTimeout(function() {
                return u.lifeCycle.emit("init");
              }, 0), u.initDelayTime = c.delay ? c.delay : 1e3, u.cycleTask(u.initDelayTime)), u;
            }
            return function(c, u) {
              if (typeof u != "function" && u !== null)
                throw new TypeError("Class extends value " + String(u) + " is not a constructor or null");
              function v() {
                this.constructor = c;
              }
              k(c, u), c.prototype = u === null ? Object.create(u) : (v.prototype = u.prototype, new v());
            }(o, g), o.prototype.initSession = function(c) {
              var u = 18e5;
              c.sessionDuration && c.sessionDuration > 3e4 && (u = c.sessionDuration), this.beaconSession = new j(this.storage, u, this);
            }, o.prototype.initCommonInfo = function(c) {
              var u = Number(this.storage.getItem(G));
              try {
                var v = JSON.parse(this.storage.getItem(X));
                (Date.now() - u > 3e4 || !v) && this.storage.setItem(X, JSON.stringify([]));
              } catch {
              }
              c.uploadUrl && (this.uploadUrl = c.uploadUrl + "?appkey=" + c.appkey);
              var R = [window.screen.width, window.screen.height];
              window.devicePixelRatio && R.push(window.devicePixelRatio), this.commonInfo = {
                deviceId: this.storage.createDeviceId(),
                language: navigator && navigator.language || "zh_CN",
                query: window.location.search,
                userAgent: navigator.userAgent,
                pixel: R.join("*"),
                channelID: c.channelID ? String(c.channelID) : "",
                openid: c.openid ? String(c.openid) : "",
                unid: c.unionid ? String(c.unionid) : "",
                sdkVersion: U
              }, this.config.appVersion = c.versionCode ? String(c.versionCode) : "", this.config.strictMode = c.strictMode;
            }, o.prototype.cycleTask = function(c) {
              var u = this;
              this.intervalID = window.setInterval(function() {
                u.pauseSearching || u.store.getEvents().then(function(v) {
                  v.length == 0 && (u.pauseSearching = !0);
                  var R = [], I = JSON.parse(u.storage.getItem(X));
                  I || (I = []), v && v.forEach(function(Z) {
                    var ge = _(Z.mapValue);
                    I.indexOf(ge) == -1 && (R.push(Z), I.push(ge));
                  }), R.length != 0 && (u.storage.setItem(X, JSON.stringify(I)), u._normalLogPipeline(u.assembleData(R)));
                }).catch(function(v) {
                });
              }, c);
            }, o.prototype.onReport = function(c, u, v) {
              var R = this;
              if (this.isUnderIE8)
                this.errorReport.reportError("601", "UnderIE8");
              else {
                this.pauseSearching = !1;
                var I = this.generateData(c, u, v);
                if (v && this.delayTime == 0 && !this.underWeakNet)
                  this._normalLogPipeline(this.assembleData(I));
                else {
                  var Z = I.shift();
                  Z && this.store.insertEvent(Z, function(ge) {
                    ge && R.errorReport.reportError("604", "insertEvent fail!");
                  }).catch(function(ge) {
                    R._normalLogPipeline(R.assembleData(I));
                  });
                }
              }
            }, o.prototype.onSendBeacon = function(c, u) {
              if (this.isUnderIE)
                this.errorReport.reportError("605", "UnderIE");
              else {
                this.pauseSearching = !1;
                var v = this.assembleData(this.generateData(c, u, !0));
                typeof navigator.sendBeacon == "function" && navigator.sendBeacon(this.uploadUrl || this.strategy.getUploadUrl(), JSON.stringify(v));
              }
            }, o.prototype.generateData = function(c, u, v) {
              var R = [], I = "4.5.14-web_" + (v ? "direct_log_id" : "normal_log_id"), Z = Number(this.storage.getItem(I));
              return Z = Z || 1, u = P(P({}, u), {
                A99: v ? "Y" : "N",
                A100: Z.toString(),
                A72: U,
                A88: this.logidStartTime
              }), Z++, this.storage.setItem(I, Z.toString()), R.push({
                eventCode: c,
                eventTime: Date.now().toString(),
                mapValue: W(u, this.config.strictMode)
              }), R;
            }, o.prototype.assembleData = function(c) {
              var u = this.beaconSession.getSession();
              return {
                appVersion: this.config.appVersion ? he(this.config.appVersion) : "",
                sdkId: "js",
                sdkVersion: U,
                mainAppKey: this.config.appkey,
                platformId: 3,
                common: W(P(P({}, this.additionalParams), {
                  A2: this.commonInfo.deviceId,
                  A8: this.commonInfo.openid,
                  A12: this.commonInfo.language,
                  A17: this.commonInfo.pixel,
                  A23: this.commonInfo.channelID,
                  A50: this.commonInfo.unid,
                  A76: u.sessionId,
                  A101: this.commonInfo.userAgent,
                  A102: window.location.href,
                  A104: document.referrer,
                  A119: this.commonInfo.query,
                  A153: this.qimei36
                }), !1),
                events: c
              };
            }, o.prototype.monitorUploadFailed = function() {
              this.uselessCycleTaskNum++, this.uselessCycleTaskNum >= 5 && (window.clearInterval(this.intervalID), this.cycleTask(6e4), this.underWeakNet = !0);
            }, o.prototype.doCustomCycleTask = function() {
              this.uselessCycleTaskNum >= 5 && (window.clearInterval(this.intervalID), this.cycleTask(this.initDelayTime)), this.uselessCycleTaskNum = 0, this.underWeakNet = !1;
            }, o;
          }(y);
        });
      },
      "./lib/crypto.js": function(r, i, n) {
        (function(d) {
          var S = n("./node_modules/@babel/runtime/helpers/typeof.js"), a = a || function(k, P) {
            var L = {}, A = L.lib = {}, B = function() {
            }, H = A.Base = {
              extend: function(T) {
                B.prototype = this;
                var y = new B();
                return T && y.mixIn(T), y.hasOwnProperty("init") || (y.init = function() {
                  y.$super.init.apply(this, arguments);
                }), y.init.prototype = y, y.$super = this, y;
              },
              create: function() {
                var T = this.extend();
                return T.init.apply(T, arguments), T;
              },
              init: function() {
              },
              mixIn: function(T) {
                for (var y in T)
                  T.hasOwnProperty(y) && (this[y] = T[y]);
                T.hasOwnProperty("toString") && (this.toString = T.toString);
              },
              clone: function() {
                return this.init.prototype.extend(this);
              }
            }, G = A.WordArray = H.extend({
              init: function(T, y) {
                T = this.words = T || [], this.sigBytes = y != P ? y : 4 * T.length;
              },
              toString: function(T) {
                return (T || N).stringify(this);
              },
              concat: function(T) {
                var y = this.words, Q = T.words, p = this.sigBytes;
                if (T = T.sigBytes, this.clamp(), p % 4)
                  for (var M = 0; M < T; M++)
                    y[p + M >>> 2] |= (Q[M >>> 2] >>> 24 - 8 * (M % 4) & 255) << 24 - 8 * ((p + M) % 4);
                else if (65535 < Q.length)
                  for (M = 0; M < T; M += 4)
                    y[p + M >>> 2] = Q[M >>> 2];
                else
                  y.push.apply(y, Q);
                return this.sigBytes += T, this;
              },
              clamp: function() {
                var T = this.words, y = this.sigBytes;
                T[y >>> 2] &= 4294967295 << 32 - 8 * (y % 4), T.length = k.ceil(y / 4);
              },
              clone: function() {
                var T = H.clone.call(this);
                return T.words = this.words.slice(0), T;
              },
              random: function(T) {
                for (var y = [], Q = 0; Q < T; Q += 4)
                  y.push(4294967296 * k.random() | 0);
                return new G.init(y, T);
              }
            }), X = L.enc = {}, N = X.Hex = {
              stringify: function(T) {
                var y = T.words;
                T = T.sigBytes;
                for (var Q = [], p = 0; p < T; p++) {
                  var M = y[p >>> 2] >>> 24 - 8 * (p % 4) & 255;
                  Q.push((M >>> 4).toString(16)), Q.push((M & 15).toString(16));
                }
                return Q.join("");
              },
              parse: function(T) {
                for (var y = T.length, Q = [], p = 0; p < y; p += 2)
                  Q[p >>> 3] |= parseInt(T.substr(p, 2), 16) << 24 - 4 * (p % 8);
                return new G.init(Q, y / 2);
              }
            }, F = X.Latin1 = {
              stringify: function(T) {
                var y = T.words;
                T = T.sigBytes;
                for (var Q = [], p = 0; p < T; p++)
                  Q.push(String.fromCharCode(y[p >>> 2] >>> 24 - 8 * (p % 4) & 255));
                return Q.join("");
              },
              parse: function(T) {
                for (var y = T.length, Q = [], p = 0; p < y; p++)
                  Q[p >>> 2] |= (T.charCodeAt(p) & 255) << 24 - 8 * (p % 4);
                return new G.init(Q, y);
              }
            }, ne = X.Utf8 = {
              stringify: function(T) {
                try {
                  return decodeURIComponent(escape(F.stringify(T)));
                } catch {
                  throw Error("Malformed UTF-8 data");
                }
              },
              parse: function(T) {
                return F.parse(unescape(encodeURIComponent(T)));
              }
            }, W = A.BufferedBlockAlgorithm = H.extend({
              reset: function() {
                this._data = new G.init(), this._nDataBytes = 0;
              },
              _append: function(T) {
                typeof T == "string" && (T = ne.parse(T)), this._data.concat(T), this._nDataBytes += T.sigBytes;
              },
              _process: function(T) {
                var y = this._data, Q = y.words, p = y.sigBytes, M = this.blockSize, j = p / (4 * M), j = T ? k.ceil(j) : k.max((j | 0) - this._minBufferSize, 0);
                if (T = j * M, p = k.min(4 * T, p), T) {
                  for (var K = 0; K < T; K += M)
                    this._doProcessBlock(Q, K);
                  K = Q.splice(0, T), y.sigBytes -= p;
                }
                return new G.init(K, p);
              },
              clone: function() {
                var T = H.clone.call(this);
                return T._data = this._data.clone(), T;
              },
              _minBufferSize: 0
            });
            A.Hasher = W.extend({
              cfg: H.extend(),
              init: function(T) {
                this.cfg = this.cfg.extend(T), this.reset();
              },
              reset: function() {
                W.reset.call(this), this._doReset();
              },
              update: function(T) {
                return this._append(T), this._process(), this;
              },
              finalize: function(T) {
                return T && this._append(T), this._doFinalize();
              },
              blockSize: 16,
              _createHelper: function(T) {
                return function(y, Q) {
                  return new T.init(Q).finalize(y);
                };
              },
              _createHmacHelper: function(T) {
                return function(y, Q) {
                  return new he.HMAC.init(T, Q).finalize(y);
                };
              }
            });
            var he = L.algo = {};
            return L;
          }(Math);
          (function() {
            var k = a, B = k.lib, P = B.WordArray, L = B.Hasher, A = [], B = k.algo.SHA1 = L.extend({
              _doReset: function() {
                this._hash = new P.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
              },
              _doProcessBlock: function(G, X) {
                for (var N = this._hash.words, F = N[0], ne = N[1], W = N[2], he = N[3], _ = N[4], T = 0; 80 > T; T++) {
                  if (16 > T)
                    A[T] = G[X + T] | 0;
                  else {
                    var y = A[T - 3] ^ A[T - 8] ^ A[T - 14] ^ A[T - 16];
                    A[T] = y << 1 | y >>> 31;
                  }
                  y = (F << 5 | F >>> 27) + _ + A[T], y = 20 > T ? y + ((ne & W | ~ne & he) + 1518500249) : 40 > T ? y + ((ne ^ W ^ he) + 1859775393) : 60 > T ? y + ((ne & W | ne & he | W & he) - 1894007588) : y + ((ne ^ W ^ he) - 899497514), _ = he, he = W, W = ne << 30 | ne >>> 2, ne = F, F = y;
                }
                N[0] = N[0] + F | 0, N[1] = N[1] + ne | 0, N[2] = N[2] + W | 0, N[3] = N[3] + he | 0, N[4] = N[4] + _ | 0;
              },
              _doFinalize: function() {
                var G = this._data, X = G.words, N = 8 * this._nDataBytes, F = 8 * G.sigBytes;
                return X[F >>> 5] |= 128 << 24 - F % 32, X[(F + 64 >>> 9 << 4) + 14] = Math.floor(N / 4294967296), X[(F + 64 >>> 9 << 4) + 15] = N, G.sigBytes = 4 * X.length, this._process(), this._hash;
              },
              clone: function() {
                var G = L.clone.call(this);
                return G._hash = this._hash.clone(), G;
              }
            });
            k.SHA1 = L._createHelper(B), k.HmacSHA1 = L._createHmacHelper(B);
          })(), function() {
            var k = a, P = k.enc.Utf8;
            k.algo.HMAC = k.lib.Base.extend({
              init: function(A, B) {
                A = this._hasher = new A.init(), typeof B == "string" && (B = P.parse(B));
                var H = A.blockSize, G = 4 * H;
                B.sigBytes > G && (B = A.finalize(B)), B.clamp();
                for (var X = this._oKey = B.clone(), N = this._iKey = B.clone(), F = X.words, ne = N.words, W = 0; W < H; W++)
                  F[W] ^= 1549556828, ne[W] ^= 909522486;
                X.sigBytes = N.sigBytes = G, this.reset();
              },
              reset: function() {
                var A = this._hasher;
                A.reset(), A.update(this._iKey);
              },
              update: function(A) {
                return this._hasher.update(A), this;
              },
              finalize: function(A) {
                var B = this._hasher;
                return A = B.finalize(A), B.reset(), B.finalize(this._oKey.clone().concat(A));
              }
            });
          }(), function() {
            var k = a, P = k.lib, L = P.WordArray, A = k.enc;
            A.Base64 = {
              stringify: function(H) {
                var G = H.words, X = H.sigBytes, N = this._map;
                H.clamp();
                for (var F = [], ne = 0; ne < X; ne += 3)
                  for (var W = G[ne >>> 2] >>> 24 - ne % 4 * 8 & 255, he = G[ne + 1 >>> 2] >>> 24 - (ne + 1) % 4 * 8 & 255, _ = G[ne + 2 >>> 2] >>> 24 - (ne + 2) % 4 * 8 & 255, T = W << 16 | he << 8 | _, y = 0; y < 4 && ne + y * 0.75 < X; y++)
                    F.push(N.charAt(T >>> 6 * (3 - y) & 63));
                var Q = N.charAt(64);
                if (Q)
                  for (; F.length % 4; )
                    F.push(Q);
                return F.join("");
              },
              parse: function(H) {
                var G = H.length, X = this._map, N = X.charAt(64);
                if (N) {
                  var F = H.indexOf(N);
                  F != -1 && (G = F);
                }
                for (var ne = [], W = 0, he = 0; he < G; he++)
                  if (he % 4) {
                    var _ = X.indexOf(H.charAt(he - 1)) << he % 4 * 2, T = X.indexOf(H.charAt(he)) >>> 6 - he % 4 * 2;
                    ne[W >>> 2] |= (_ | T) << 24 - W % 4 * 8, W++;
                  }
                return L.create(ne, W);
              },
              _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
            };
          }(), S(d) === "object" ? d.exports = a : window.CryptoJS = a;
        }).call(this, n("./node_modules/webpack/buildin/module.js")(r));
      },
      "./lib/json2xml.js": function(r, i, n) {
        var d = n("./node_modules/@babel/runtime/helpers/typeof.js"), S = "a-zA-Z_\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FFF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD", a = "-.0-9\xB7\u0300-\u036F\u203F\u2040", k = new RegExp("^([^" + S + "])|^((x|X)(m|M)(l|L))|([^" + S + a + "])", "g"), P = /[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm, L = function(X) {
          var N = [];
          if (X instanceof Object)
            for (var F in X)
              X.hasOwnProperty(F) && N.push(F);
          return N;
        }, A = function(X, N) {
          var F = function(W, he, _, T, y) {
            var Q = N.indent !== void 0 ? N.indent : "	", p = N.prettyPrint ? `
` + new Array(T).join(Q) : "";
            N.removeIllegalNameCharacters && (W = W.replace(k, "_"));
            var M = [p, "<", W, _ || ""];
            return he && he.length > 0 ? (M.push(">"), M.push(he), y && M.push(p), M.push("</"), M.push(W), M.push(">")) : M.push("/>"), M.join("");
          };
          return function ne(W, he, _) {
            var T = d(W);
            switch ((Array.isArray ? Array.isArray(W) : W instanceof Array) ? T = "array" : W instanceof Date && (T = "date"), T) {
              case "array":
                var y = [];
                return W.map(function(j) {
                  y.push(ne(j, 1, _ + 1));
                }), N.prettyPrint && y.push(`
`), y.join("");
              case "date":
                return W.toJSON ? W.toJSON() : W + "";
              case "object":
                var Q = [];
                for (var p in W)
                  if (W.hasOwnProperty(p))
                    if (W[p] instanceof Array)
                      for (var M = 0; M < W[p].length; M++)
                        W[p].hasOwnProperty(M) && Q.push(F(p, ne(W[p][M], 0, _ + 1), null, _ + 1, L(W[p][M]).length));
                    else
                      Q.push(F(p, ne(W[p], 0, _ + 1), null, _ + 1));
                return N.prettyPrint && Q.length > 0 && Q.push(`
`), Q.join("");
              case "function":
                return W();
              default:
                return N.escape ? H(W) : "" + W;
            }
          }(X, 0, 0);
        }, B = function(X) {
          var N = ['<?xml version="1.0" encoding="UTF-8"'];
          return X && N.push(' standalone="yes"'), N.push("?>"), N.join("");
        };
        function H(G) {
          return ("" + G).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&apos;").replace(/"/g, "&quot;").replace(P, "");
        }
        r.exports = function(G, X) {
          if (X || (X = {
            xmlHeader: {
              standalone: !0
            },
            prettyPrint: !0,
            indent: "  ",
            escape: !0
          }), typeof G == "string")
            try {
              G = JSON.parse(G.toString());
            } catch {
              return !1;
            }
          var N = "", F = "";
          X && (d(X) == "object" ? (X.xmlHeader && (N = B(!!X.xmlHeader.standalone)), typeof X.docType < "u" && (F = "<!DOCTYPE " + X.docType + ">")) : N = B()), X = X || {};
          var ne = [N, X.prettyPrint && F ? `
` : "", F, A(G, X)];
          return ne.join("").replace(/\n{2,}/g, `
`).replace(/\s+$/g, "");
        };
      },
      "./lib/md5.js": function(module, exports, __webpack_require__) {
        (function(process, global, module) {
          var __WEBPACK_AMD_DEFINE_RESULT__, _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");
          (function() {
            var ERROR = "input is invalid type", WINDOW = (typeof window > "u" ? "undefined" : _typeof(window)) === "object", root = WINDOW ? window : {};
            root.JS_MD5_NO_WINDOW && (WINDOW = !1);
            var WEB_WORKER = !WINDOW && (typeof self > "u" ? "undefined" : _typeof(self)) === "object", NODE_JS = !root.JS_MD5_NO_NODE_JS && (typeof process > "u" ? "undefined" : _typeof(process)) === "object" && process.versions && process.versions.node;
            NODE_JS ? root = global : WEB_WORKER && (root = self);
            var COMMON_JS = !root.JS_MD5_NO_COMMON_JS && _typeof(module) === "object" && module.exports, AMD = __webpack_require__("./node_modules/webpack/buildin/amd-options.js"), ARRAY_BUFFER = !root.JS_MD5_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u", HEX_CHARS = "0123456789abcdef".split(""), EXTRA = [128, 32768, 8388608, -2147483648], SHIFT = [0, 8, 16, 24], OUTPUT_TYPES = ["hex", "array", "digest", "buffer", "arrayBuffer", "base64"], BASE64_ENCODE_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), blocks = [], buffer8;
            if (ARRAY_BUFFER) {
              var buffer = new ArrayBuffer(68);
              buffer8 = new Uint8Array(buffer), blocks = new Uint32Array(buffer);
            }
            (root.JS_MD5_NO_NODE_JS || !Array.isArray) && (Array.isArray = function(r) {
              return Object.prototype.toString.call(r) === "[object Array]";
            }), ARRAY_BUFFER && (root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function(r) {
              return _typeof(r) === "object" && r.buffer && r.buffer.constructor === ArrayBuffer;
            });
            var createOutputMethod = function(i) {
              return function(n, d) {
                return new Md5(!0).update(n, d)[i]();
              };
            }, createMethod = function() {
              var i = createOutputMethod("hex");
              NODE_JS && (i = nodeWrap(i)), i.getCtx = i.create = function() {
                return new Md5();
              }, i.update = function(S) {
                return i.create().update(S);
              };
              for (var n = 0; n < OUTPUT_TYPES.length; ++n) {
                var d = OUTPUT_TYPES[n];
                i[d] = createOutputMethod(d);
              }
              return i;
            }, nodeWrap = function nodeWrap(method) {
              var crypto = eval("require('crypto')"), Buffer = eval("require('buffer').Buffer"), nodeMethod = function r(i) {
                if (typeof i == "string")
                  return crypto.createHash("md5").update(i, "utf8").digest("hex");
                if (i == null)
                  throw ERROR;
                return i.constructor === ArrayBuffer && (i = new Uint8Array(i)), Array.isArray(i) || ArrayBuffer.isView(i) || i.constructor === Buffer ? crypto.createHash("md5").update(new Buffer(i)).digest("hex") : method(i);
              };
              return nodeMethod;
            };
            function Md5(r) {
              if (r)
                blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0, this.blocks = blocks, this.buffer8 = buffer8;
              else if (ARRAY_BUFFER) {
                var i = new ArrayBuffer(68);
                this.buffer8 = new Uint8Array(i), this.blocks = new Uint32Array(i);
              } else
                this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
              this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0, this.finalized = this.hashed = !1, this.first = !0;
            }
            Md5.prototype.update = function(r, i) {
              if (!this.finalized) {
                for (var n, d = 0, S, a = r.length, k = this.blocks, P = this.buffer8; d < a; ) {
                  if (this.hashed && (this.hashed = !1, k[0] = k[16], k[16] = k[1] = k[2] = k[3] = k[4] = k[5] = k[6] = k[7] = k[8] = k[9] = k[10] = k[11] = k[12] = k[13] = k[14] = k[15] = 0), ARRAY_BUFFER)
                    for (S = this.start; d < a && S < 64; ++d)
                      n = r.charCodeAt(d), i || n < 128 ? P[S++] = n : n < 2048 ? (P[S++] = 192 | n >> 6, P[S++] = 128 | n & 63) : n < 55296 || n >= 57344 ? (P[S++] = 224 | n >> 12, P[S++] = 128 | n >> 6 & 63, P[S++] = 128 | n & 63) : (n = 65536 + ((n & 1023) << 10 | r.charCodeAt(++d) & 1023), P[S++] = 240 | n >> 18, P[S++] = 128 | n >> 12 & 63, P[S++] = 128 | n >> 6 & 63, P[S++] = 128 | n & 63);
                  else
                    for (S = this.start; d < a && S < 64; ++d)
                      n = r.charCodeAt(d), i || n < 128 ? k[S >> 2] |= n << SHIFT[S++ & 3] : n < 2048 ? (k[S >> 2] |= (192 | n >> 6) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n & 63) << SHIFT[S++ & 3]) : n < 55296 || n >= 57344 ? (k[S >> 2] |= (224 | n >> 12) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n >> 6 & 63) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n & 63) << SHIFT[S++ & 3]) : (n = 65536 + ((n & 1023) << 10 | r.charCodeAt(++d) & 1023), k[S >> 2] |= (240 | n >> 18) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n >> 12 & 63) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n >> 6 & 63) << SHIFT[S++ & 3], k[S >> 2] |= (128 | n & 63) << SHIFT[S++ & 3]);
                  this.lastByteIndex = S, this.bytes += S - this.start, S >= 64 ? (this.start = S - 64, this.hash(), this.hashed = !0) : this.start = S;
                }
                return this.bytes > 4294967295 && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296), this;
              }
            }, Md5.prototype.finalize = function() {
              if (!this.finalized) {
                this.finalized = !0;
                var r = this.blocks, i = this.lastByteIndex;
                r[i >> 2] |= EXTRA[i & 3], i >= 56 && (this.hashed || this.hash(), r[0] = r[16], r[16] = r[1] = r[2] = r[3] = r[4] = r[5] = r[6] = r[7] = r[8] = r[9] = r[10] = r[11] = r[12] = r[13] = r[14] = r[15] = 0), r[14] = this.bytes << 3, r[15] = this.hBytes << 3 | this.bytes >>> 29, this.hash();
              }
            }, Md5.prototype.hash = function() {
              var r, i, n, d, S, a, k = this.blocks;
              this.first ? (r = k[0] - 680876937, r = (r << 7 | r >>> 25) - 271733879 << 0, d = (-1732584194 ^ r & 2004318071) + k[1] - 117830708, d = (d << 12 | d >>> 20) + r << 0, n = (-271733879 ^ d & (r ^ -271733879)) + k[2] - 1126478375, n = (n << 17 | n >>> 15) + d << 0, i = (r ^ n & (d ^ r)) + k[3] - 1316259209, i = (i << 22 | i >>> 10) + n << 0) : (r = this.h0, i = this.h1, n = this.h2, d = this.h3, r += (d ^ i & (n ^ d)) + k[0] - 680876936, r = (r << 7 | r >>> 25) + i << 0, d += (n ^ r & (i ^ n)) + k[1] - 389564586, d = (d << 12 | d >>> 20) + r << 0, n += (i ^ d & (r ^ i)) + k[2] + 606105819, n = (n << 17 | n >>> 15) + d << 0, i += (r ^ n & (d ^ r)) + k[3] - 1044525330, i = (i << 22 | i >>> 10) + n << 0), r += (d ^ i & (n ^ d)) + k[4] - 176418897, r = (r << 7 | r >>> 25) + i << 0, d += (n ^ r & (i ^ n)) + k[5] + 1200080426, d = (d << 12 | d >>> 20) + r << 0, n += (i ^ d & (r ^ i)) + k[6] - 1473231341, n = (n << 17 | n >>> 15) + d << 0, i += (r ^ n & (d ^ r)) + k[7] - 45705983, i = (i << 22 | i >>> 10) + n << 0, r += (d ^ i & (n ^ d)) + k[8] + 1770035416, r = (r << 7 | r >>> 25) + i << 0, d += (n ^ r & (i ^ n)) + k[9] - 1958414417, d = (d << 12 | d >>> 20) + r << 0, n += (i ^ d & (r ^ i)) + k[10] - 42063, n = (n << 17 | n >>> 15) + d << 0, i += (r ^ n & (d ^ r)) + k[11] - 1990404162, i = (i << 22 | i >>> 10) + n << 0, r += (d ^ i & (n ^ d)) + k[12] + 1804603682, r = (r << 7 | r >>> 25) + i << 0, d += (n ^ r & (i ^ n)) + k[13] - 40341101, d = (d << 12 | d >>> 20) + r << 0, n += (i ^ d & (r ^ i)) + k[14] - 1502002290, n = (n << 17 | n >>> 15) + d << 0, i += (r ^ n & (d ^ r)) + k[15] + 1236535329, i = (i << 22 | i >>> 10) + n << 0, r += (n ^ d & (i ^ n)) + k[1] - 165796510, r = (r << 5 | r >>> 27) + i << 0, d += (i ^ n & (r ^ i)) + k[6] - 1069501632, d = (d << 9 | d >>> 23) + r << 0, n += (r ^ i & (d ^ r)) + k[11] + 643717713, n = (n << 14 | n >>> 18) + d << 0, i += (d ^ r & (n ^ d)) + k[0] - 373897302, i = (i << 20 | i >>> 12) + n << 0, r += (n ^ d & (i ^ n)) + k[5] - 701558691, r = (r << 5 | r >>> 27) + i << 0, d += (i ^ n & (r ^ i)) + k[10] + 38016083, d = (d << 9 | d >>> 23) + r << 0, n += (r ^ i & (d ^ r)) + k[15] - 660478335, n = (n << 14 | n >>> 18) + d << 0, i += (d ^ r & (n ^ d)) + k[4] - 405537848, i = (i << 20 | i >>> 12) + n << 0, r += (n ^ d & (i ^ n)) + k[9] + 568446438, r = (r << 5 | r >>> 27) + i << 0, d += (i ^ n & (r ^ i)) + k[14] - 1019803690, d = (d << 9 | d >>> 23) + r << 0, n += (r ^ i & (d ^ r)) + k[3] - 187363961, n = (n << 14 | n >>> 18) + d << 0, i += (d ^ r & (n ^ d)) + k[8] + 1163531501, i = (i << 20 | i >>> 12) + n << 0, r += (n ^ d & (i ^ n)) + k[13] - 1444681467, r = (r << 5 | r >>> 27) + i << 0, d += (i ^ n & (r ^ i)) + k[2] - 51403784, d = (d << 9 | d >>> 23) + r << 0, n += (r ^ i & (d ^ r)) + k[7] + 1735328473, n = (n << 14 | n >>> 18) + d << 0, i += (d ^ r & (n ^ d)) + k[12] - 1926607734, i = (i << 20 | i >>> 12) + n << 0, S = i ^ n, r += (S ^ d) + k[5] - 378558, r = (r << 4 | r >>> 28) + i << 0, d += (S ^ r) + k[8] - 2022574463, d = (d << 11 | d >>> 21) + r << 0, a = d ^ r, n += (a ^ i) + k[11] + 1839030562, n = (n << 16 | n >>> 16) + d << 0, i += (a ^ n) + k[14] - 35309556, i = (i << 23 | i >>> 9) + n << 0, S = i ^ n, r += (S ^ d) + k[1] - 1530992060, r = (r << 4 | r >>> 28) + i << 0, d += (S ^ r) + k[4] + 1272893353, d = (d << 11 | d >>> 21) + r << 0, a = d ^ r, n += (a ^ i) + k[7] - 155497632, n = (n << 16 | n >>> 16) + d << 0, i += (a ^ n) + k[10] - 1094730640, i = (i << 23 | i >>> 9) + n << 0, S = i ^ n, r += (S ^ d) + k[13] + 681279174, r = (r << 4 | r >>> 28) + i << 0, d += (S ^ r) + k[0] - 358537222, d = (d << 11 | d >>> 21) + r << 0, a = d ^ r, n += (a ^ i) + k[3] - 722521979, n = (n << 16 | n >>> 16) + d << 0, i += (a ^ n) + k[6] + 76029189, i = (i << 23 | i >>> 9) + n << 0, S = i ^ n, r += (S ^ d) + k[9] - 640364487, r = (r << 4 | r >>> 28) + i << 0, d += (S ^ r) + k[12] - 421815835, d = (d << 11 | d >>> 21) + r << 0, a = d ^ r, n += (a ^ i) + k[15] + 530742520, n = (n << 16 | n >>> 16) + d << 0, i += (a ^ n) + k[2] - 995338651, i = (i << 23 | i >>> 9) + n << 0, r += (n ^ (i | ~d)) + k[0] - 198630844, r = (r << 6 | r >>> 26) + i << 0, d += (i ^ (r | ~n)) + k[7] + 1126891415, d = (d << 10 | d >>> 22) + r << 0, n += (r ^ (d | ~i)) + k[14] - 1416354905, n = (n << 15 | n >>> 17) + d << 0, i += (d ^ (n | ~r)) + k[5] - 57434055, i = (i << 21 | i >>> 11) + n << 0, r += (n ^ (i | ~d)) + k[12] + 1700485571, r = (r << 6 | r >>> 26) + i << 0, d += (i ^ (r | ~n)) + k[3] - 1894986606, d = (d << 10 | d >>> 22) + r << 0, n += (r ^ (d | ~i)) + k[10] - 1051523, n = (n << 15 | n >>> 17) + d << 0, i += (d ^ (n | ~r)) + k[1] - 2054922799, i = (i << 21 | i >>> 11) + n << 0, r += (n ^ (i | ~d)) + k[8] + 1873313359, r = (r << 6 | r >>> 26) + i << 0, d += (i ^ (r | ~n)) + k[15] - 30611744, d = (d << 10 | d >>> 22) + r << 0, n += (r ^ (d | ~i)) + k[6] - 1560198380, n = (n << 15 | n >>> 17) + d << 0, i += (d ^ (n | ~r)) + k[13] + 1309151649, i = (i << 21 | i >>> 11) + n << 0, r += (n ^ (i | ~d)) + k[4] - 145523070, r = (r << 6 | r >>> 26) + i << 0, d += (i ^ (r | ~n)) + k[11] - 1120210379, d = (d << 10 | d >>> 22) + r << 0, n += (r ^ (d | ~i)) + k[2] + 718787259, n = (n << 15 | n >>> 17) + d << 0, i += (d ^ (n | ~r)) + k[9] - 343485551, i = (i << 21 | i >>> 11) + n << 0, this.first ? (this.h0 = r + 1732584193 << 0, this.h1 = i - 271733879 << 0, this.h2 = n - 1732584194 << 0, this.h3 = d + 271733878 << 0, this.first = !1) : (this.h0 = this.h0 + r << 0, this.h1 = this.h1 + i << 0, this.h2 = this.h2 + n << 0, this.h3 = this.h3 + d << 0);
            }, Md5.prototype.hex = function() {
              this.finalize();
              var r = this.h0, i = this.h1, n = this.h2, d = this.h3;
              return HEX_CHARS[r >> 4 & 15] + HEX_CHARS[r & 15] + HEX_CHARS[r >> 12 & 15] + HEX_CHARS[r >> 8 & 15] + HEX_CHARS[r >> 20 & 15] + HEX_CHARS[r >> 16 & 15] + HEX_CHARS[r >> 28 & 15] + HEX_CHARS[r >> 24 & 15] + HEX_CHARS[i >> 4 & 15] + HEX_CHARS[i & 15] + HEX_CHARS[i >> 12 & 15] + HEX_CHARS[i >> 8 & 15] + HEX_CHARS[i >> 20 & 15] + HEX_CHARS[i >> 16 & 15] + HEX_CHARS[i >> 28 & 15] + HEX_CHARS[i >> 24 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[n & 15] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[d >> 4 & 15] + HEX_CHARS[d & 15] + HEX_CHARS[d >> 12 & 15] + HEX_CHARS[d >> 8 & 15] + HEX_CHARS[d >> 20 & 15] + HEX_CHARS[d >> 16 & 15] + HEX_CHARS[d >> 28 & 15] + HEX_CHARS[d >> 24 & 15];
            }, Md5.prototype.toString = Md5.prototype.hex, Md5.prototype.digest = function(r) {
              if (r === "hex")
                return this.hex();
              this.finalize();
              var i = this.h0, n = this.h1, d = this.h2, S = this.h3, a = [i & 255, i >> 8 & 255, i >> 16 & 255, i >> 24 & 255, n & 255, n >> 8 & 255, n >> 16 & 255, n >> 24 & 255, d & 255, d >> 8 & 255, d >> 16 & 255, d >> 24 & 255, S & 255, S >> 8 & 255, S >> 16 & 255, S >> 24 & 255];
              return a;
            }, Md5.prototype.array = Md5.prototype.digest, Md5.prototype.arrayBuffer = function() {
              this.finalize();
              var r = new ArrayBuffer(16), i = new Uint32Array(r);
              return i[0] = this.h0, i[1] = this.h1, i[2] = this.h2, i[3] = this.h3, r;
            }, Md5.prototype.buffer = Md5.prototype.arrayBuffer, Md5.prototype.base64 = function() {
              for (var r, i, n, d = "", S = this.array(), a = 0; a < 15; )
                r = S[a++], i = S[a++], n = S[a++], d += BASE64_ENCODE_CHAR[r >>> 2] + BASE64_ENCODE_CHAR[(r << 4 | i >>> 4) & 63] + BASE64_ENCODE_CHAR[(i << 2 | n >>> 6) & 63] + BASE64_ENCODE_CHAR[n & 63];
              return r = S[a], d += BASE64_ENCODE_CHAR[r >>> 2] + BASE64_ENCODE_CHAR[r << 4 & 63] + "==", d;
            };
            var exports = createMethod();
            COMMON_JS ? module.exports = exports : (root.md5 = exports, AMD && (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
              return exports;
            }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)));
          })();
        }).call(this, __webpack_require__("./node_modules/process/browser.js"), __webpack_require__("./node_modules/webpack/buildin/global.js"), __webpack_require__("./node_modules/webpack/buildin/module.js")(module));
      },
      "./lib/request.js": function(r, i, n) {
        var d = n("./node_modules/@babel/runtime/helpers/typeof.js"), S = function(B) {
          switch (d(B)) {
            case "string":
              return B;
            case "boolean":
              return B ? "true" : "false";
            case "number":
              return isFinite(B) ? B : "";
            default:
              return "";
          }
        }, a = function(B, H, G, X) {
          return H = H || "&", G = G || "=", B === null && (B = void 0), d(B) === "object" ? Object.keys(B).map(function(N) {
            var F = encodeURIComponent(S(N)) + G;
            return Array.isArray(B[N]) ? B[N].map(function(ne) {
              return F + encodeURIComponent(S(ne));
            }).join(H) : F + encodeURIComponent(S(B[N]));
          }).filter(Boolean).join(H) : X ? encodeURIComponent(S(X)) + G + encodeURIComponent(S(B)) : "";
        }, k = function(B, H, G) {
          var X = {};
          return H.getAllResponseHeaders().trim().split(`
`).forEach(function(N) {
            if (N) {
              var F = N.indexOf(":"), ne = N.substr(0, F).trim().toLowerCase(), W = N.substr(F + 1).trim();
              X[ne] = W;
            }
          }), {
            error: B,
            statusCode: H.status,
            statusMessage: H.statusText,
            headers: X,
            body: G
          };
        }, P = function(B, H) {
          return !H && H === "text" ? B.responseText : B.response;
        }, L = function(B, H) {
          var G = (B.method || "GET").toUpperCase(), X = B.url;
          if (B.qs) {
            var N = a(B.qs);
            N && (X += (X.indexOf("?") === -1 ? "?" : "&") + N);
          }
          var F = new XMLHttpRequest();
          if (F.open(G, X, !0), F.responseType = B.dataType || "text", B.xhrFields)
            for (var ne in B.xhrFields)
              F[ne] = B.xhrFields[ne];
          var W = B.headers;
          if (W)
            for (var he in W)
              W.hasOwnProperty(he) && he.toLowerCase() !== "content-length" && he.toLowerCase() !== "user-agent" && he.toLowerCase() !== "origin" && he.toLowerCase() !== "host" && F.setRequestHeader(he, W[he]);
          return B.onProgress && F.upload && (F.upload.onprogress = B.onProgress), B.onDownloadProgress && (F.onprogress = B.onDownloadProgress), B.timeout && (F.timeout = B.timeout), F.ontimeout = function(_) {
            var T = new Error("timeout");
            H(k(T, F));
          }, F.onload = function() {
            H(k(null, F, P(F, B.dataType)));
          }, F.onerror = function(_) {
            var T = P(F, B.dataType);
            if (T)
              H(k(null, F, T));
            else {
              var y = F.statusText;
              !y && F.status === 0 && (y = new Error("CORS blocked or network error")), H(k(y, F, T));
            }
          }, F.send(B.body || ""), F;
        };
        r.exports = L;
      },
      "./lib/xml2json.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser, S = function() {
          this.version = "1.3.5";
          var k = {
            mergeCDATA: !0,
            normalize: !0,
            stripElemPrefix: !0
          }, P = new RegExp(/(?!xmlns)^.*:/);
          return this.grokType = function(L) {
            return /^\s*$/.test(L) ? null : /^(?:true|false)$/i.test(L) ? L.toLowerCase() === "true" : isFinite(L) ? parseFloat(L) : L;
          }, this.parseString = function(L, A) {
            if (L) {
              var B = this.stringToXML(L);
              return B.getElementsByTagName("parsererror").length ? null : this.parseXML(B, A);
            } else
              return null;
          }, this.parseXML = function(L, A) {
            for (var B in A)
              k[B] = A[B];
            var H = {}, G = 0, X = "", N = L.childNodes.length;
            if (N)
              for (var F, ne, W, he = 0; he < L.childNodes.length; he++)
                F = L.childNodes.item(he), F.nodeType === 4 ? k.mergeCDATA && (X += F.nodeValue) : F.nodeType === 3 ? X += F.nodeValue : F.nodeType === 1 && (G === 0 && (H = {}), k.stripElemPrefix ? ne = F.nodeName.replace(P, "") : ne = F.nodeName, W = S.parseXML(F), H.hasOwnProperty(ne) ? (H[ne].constructor !== Array && (H[ne] = [H[ne]]), H[ne].push(W)) : (H[ne] = W, G++));
            return Object.keys(H).length || (H = X || ""), H;
          }, this.xmlToString = function(L) {
            try {
              var A = L.xml ? L.xml : new XMLSerializer().serializeToString(L);
              return A;
            } catch {
              return null;
            }
          }, this.stringToXML = function(L) {
            try {
              var A = null;
              if (window.DOMParser) {
                var B = new d();
                return A = B.parseFromString(L, "text/xml"), A;
              } else
                return A = new ActiveXObject("Microsoft.XMLDOM"), A.async = !1, A.loadXML(L), A;
            } catch {
              return null;
            }
          }, this;
        }.call({}), a = function(P) {
          return S.parseString(P);
        };
        r.exports = a;
      },
      "./node_modules/@babel/runtime/helpers/classCallCheck.js": function(r, i) {
        function n(d, S) {
          if (!(d instanceof S))
            throw new TypeError("Cannot call a class as a function");
        }
        r.exports = n, r.exports.__esModule = !0, r.exports.default = r.exports;
      },
      "./node_modules/@babel/runtime/helpers/createClass.js": function(r, i) {
        function n(S, a) {
          for (var k = 0; k < a.length; k++) {
            var P = a[k];
            P.enumerable = P.enumerable || !1, P.configurable = !0, "value" in P && (P.writable = !0), Object.defineProperty(S, P.key, P);
          }
        }
        function d(S, a, k) {
          return a && n(S.prototype, a), k && n(S, k), Object.defineProperty(S, "prototype", {
            writable: !1
          }), S;
        }
        r.exports = d, r.exports.__esModule = !0, r.exports.default = r.exports;
      },
      "./node_modules/@babel/runtime/helpers/typeof.js": function(r, i) {
        function n(d) {
          return r.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
            return typeof S;
          } : function(S) {
            return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
          }, r.exports.__esModule = !0, r.exports.default = r.exports, n(d);
        }
        r.exports = n, r.exports.__esModule = !0, r.exports.default = r.exports;
      },
      "./node_modules/@xmldom/xmldom/lib/conventions.js": function(r, i, n) {
        function d(L, A, B) {
          if (B === void 0 && (B = Array.prototype), L && typeof B.find == "function")
            return B.find.call(L, A);
          for (var H = 0; H < L.length; H++)
            if (Object.prototype.hasOwnProperty.call(L, H)) {
              var G = L[H];
              if (A.call(void 0, G, H, L))
                return G;
            }
        }
        function S(L, A) {
          return A === void 0 && (A = Object), A && typeof A.freeze == "function" ? A.freeze(L) : L;
        }
        function a(L, A) {
          if (L === null || typeof L != "object")
            throw new TypeError("target is not an object");
          for (var B in A)
            Object.prototype.hasOwnProperty.call(A, B) && (L[B] = A[B]);
          return L;
        }
        var k = S({
          HTML: "text/html",
          isHTML: function(L) {
            return L === k.HTML;
          },
          XML_APPLICATION: "application/xml",
          XML_TEXT: "text/xml",
          XML_XHTML_APPLICATION: "application/xhtml+xml",
          XML_SVG_IMAGE: "image/svg+xml"
        }), P = S({
          HTML: "http://www.w3.org/1999/xhtml",
          isHTML: function(L) {
            return L === P.HTML;
          },
          SVG: "http://www.w3.org/2000/svg",
          XML: "http://www.w3.org/XML/1998/namespace",
          XMLNS: "http://www.w3.org/2000/xmlns/"
        });
        i.assign = a, i.find = d, i.freeze = S, i.MIME_TYPE = k, i.NAMESPACE = P;
      },
      "./node_modules/@xmldom/xmldom/lib/dom-parser.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/conventions.js"), S = n("./node_modules/@xmldom/xmldom/lib/dom.js"), a = n("./node_modules/@xmldom/xmldom/lib/entities.js"), k = n("./node_modules/@xmldom/xmldom/lib/sax.js"), P = S.DOMImplementation, L = d.NAMESPACE, A = k.ParseError, B = k.XMLReader;
        function H(_) {
          return _.replace(/\r[\n\u0085]/g, `
`).replace(/[\r\u0085\u2028]/g, `
`);
        }
        function G(_) {
          this.options = _ || { locator: {} };
        }
        G.prototype.parseFromString = function(_, T) {
          var y = this.options, Q = new B(), p = y.domBuilder || new N(), M = y.errorHandler, j = y.locator, K = y.xmlns || {}, oe = /\/x?html?$/.test(T), w = oe ? a.HTML_ENTITIES : a.XML_ENTITIES;
          j && p.setDocumentLocator(j), Q.errorHandler = X(M, p, j), Q.domBuilder = y.domBuilder || p, oe && (K[""] = L.HTML), K.xml = K.xml || L.XML;
          var z = y.normalizeLineEndings || H;
          return _ && typeof _ == "string" ? Q.parse(
            z(_),
            K,
            w
          ) : Q.errorHandler.error("invalid doc source"), p.doc;
        };
        function X(_, T, y) {
          if (!_) {
            if (T instanceof N)
              return T;
            _ = T;
          }
          var Q = {}, p = _ instanceof Function;
          y = y || {};
          function M(j) {
            var K = _[j];
            !K && p && (K = _.length == 2 ? function(oe) {
              _(j, oe);
            } : _), Q[j] = K && function(oe) {
              K("[xmldom " + j + "]	" + oe + ne(y));
            } || function() {
            };
          }
          return M("warning"), M("error"), M("fatalError"), Q;
        }
        function N() {
          this.cdata = !1;
        }
        function F(_, T) {
          T.lineNumber = _.lineNumber, T.columnNumber = _.columnNumber;
        }
        N.prototype = {
          startDocument: function() {
            this.doc = new P().createDocument(null, null, null), this.locator && (this.doc.documentURI = this.locator.systemId);
          },
          startElement: function(_, T, y, Q) {
            var p = this.doc, M = p.createElementNS(_, y || T), j = Q.length;
            he(this, M), this.currentElement = M, this.locator && F(this.locator, M);
            for (var K = 0; K < j; K++) {
              var _ = Q.getURI(K), oe = Q.getValue(K), y = Q.getQName(K), w = p.createAttributeNS(_, y);
              this.locator && F(Q.getLocator(K), w), w.value = w.nodeValue = oe, M.setAttributeNode(w);
            }
          },
          endElement: function(_, T, y) {
            var Q = this.currentElement;
            Q.tagName, this.currentElement = Q.parentNode;
          },
          startPrefixMapping: function(_, T) {
          },
          endPrefixMapping: function(_) {
          },
          processingInstruction: function(_, T) {
            var y = this.doc.createProcessingInstruction(_, T);
            this.locator && F(this.locator, y), he(this, y);
          },
          ignorableWhitespace: function(_, T, y) {
          },
          characters: function(_, T, y) {
            if (_ = W.apply(this, arguments), _) {
              if (this.cdata)
                var Q = this.doc.createCDATASection(_);
              else
                var Q = this.doc.createTextNode(_);
              this.currentElement ? this.currentElement.appendChild(Q) : /^\s*$/.test(_) && this.doc.appendChild(Q), this.locator && F(this.locator, Q);
            }
          },
          skippedEntity: function(_) {
          },
          endDocument: function() {
            this.doc.normalize();
          },
          setDocumentLocator: function(_) {
            (this.locator = _) && (_.lineNumber = 0);
          },
          comment: function(_, T, y) {
            _ = W.apply(this, arguments);
            var Q = this.doc.createComment(_);
            this.locator && F(this.locator, Q), he(this, Q);
          },
          startCDATA: function() {
            this.cdata = !0;
          },
          endCDATA: function() {
            this.cdata = !1;
          },
          startDTD: function(_, T, y) {
            var Q = this.doc.implementation;
            if (Q && Q.createDocumentType) {
              var p = Q.createDocumentType(_, T, y);
              this.locator && F(this.locator, p), he(this, p), this.doc.doctype = p;
            }
          },
          warning: function(_) {
            console.warn("[xmldom warning]	" + _, ne(this.locator));
          },
          error: function(_) {
            console.error("[xmldom error]	" + _, ne(this.locator));
          },
          fatalError: function(_) {
            throw new A(_, this.locator);
          }
        };
        function ne(_) {
          if (_)
            return `
@` + (_.systemId || "") + "#[line:" + _.lineNumber + ",col:" + _.columnNumber + "]";
        }
        function W(_, T, y) {
          return typeof _ == "string" ? _.substr(T, y) : _.length >= T + y || T ? new java.lang.String(_, T, y) + "" : _;
        }
        "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(_) {
          N.prototype[_] = function() {
            return null;
          };
        });
        function he(_, T) {
          _.currentElement ? _.currentElement.appendChild(T) : _.doc.appendChild(T);
        }
        i.__DOMHandler = N, i.normalizeLineEndings = H, i.DOMParser = G;
      },
      "./node_modules/@xmldom/xmldom/lib/dom.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/conventions.js"), S = d.find, a = d.NAMESPACE;
        function k(s) {
          return s !== "";
        }
        function P(s) {
          return s ? s.split(/[\t\n\f\r ]+/).filter(k) : [];
        }
        function L(s, f) {
          return s.hasOwnProperty(f) || (s[f] = !0), s;
        }
        function A(s) {
          if (!s)
            return [];
          var f = P(s);
          return Object.keys(f.reduce(L, {}));
        }
        function B(s) {
          return function(f) {
            return s && s.indexOf(f) !== -1;
          };
        }
        function H(s, f) {
          for (var E in s)
            Object.prototype.hasOwnProperty.call(s, E) && (f[E] = s[E]);
        }
        function G(s, f) {
          var E = s.prototype;
          if (!(E instanceof f)) {
            let D = function() {
            };
            D.prototype = f.prototype, D = new D(), H(E, D), s.prototype = E = D;
          }
          E.constructor != s && (typeof s != "function" && console.error("unknown Class:" + s), E.constructor = s);
        }
        var X = {}, N = X.ELEMENT_NODE = 1, F = X.ATTRIBUTE_NODE = 2, ne = X.TEXT_NODE = 3, W = X.CDATA_SECTION_NODE = 4, he = X.ENTITY_REFERENCE_NODE = 5, _ = X.ENTITY_NODE = 6, T = X.PROCESSING_INSTRUCTION_NODE = 7, y = X.COMMENT_NODE = 8, Q = X.DOCUMENT_NODE = 9, p = X.DOCUMENT_TYPE_NODE = 10, M = X.DOCUMENT_FRAGMENT_NODE = 11, j = X.NOTATION_NODE = 12, K = {}, oe = {};
        K.INDEX_SIZE_ERR = (oe[1] = "Index size error", 1), K.DOMSTRING_SIZE_ERR = (oe[2] = "DOMString size error", 2);
        var w = K.HIERARCHY_REQUEST_ERR = (oe[3] = "Hierarchy request error", 3);
        K.WRONG_DOCUMENT_ERR = (oe[4] = "Wrong document", 4), K.INVALID_CHARACTER_ERR = (oe[5] = "Invalid character", 5), K.NO_DATA_ALLOWED_ERR = (oe[6] = "No data allowed", 6), K.NO_MODIFICATION_ALLOWED_ERR = (oe[7] = "No modification allowed", 7);
        var z = K.NOT_FOUND_ERR = (oe[8] = "Not found", 8);
        K.NOT_SUPPORTED_ERR = (oe[9] = "Not supported", 9);
        var q = K.INUSE_ATTRIBUTE_ERR = (oe[10] = "Attribute in use", 10);
        K.INVALID_STATE_ERR = (oe[11] = "Invalid state", 11), K.SYNTAX_ERR = (oe[12] = "Syntax error", 12), K.INVALID_MODIFICATION_ERR = (oe[13] = "Invalid modification", 13), K.NAMESPACE_ERR = (oe[14] = "Invalid namespace", 14), K.INVALID_ACCESS_ERR = (oe[15] = "Invalid access", 15);
        function V(s, f) {
          if (f instanceof Error)
            var E = f;
          else
            E = this, Error.call(this, oe[s]), this.message = oe[s], Error.captureStackTrace && Error.captureStackTrace(this, V);
          return E.code = s, f && (this.message = this.message + ": " + f), E;
        }
        V.prototype = Error.prototype, H(K, V);
        function Y() {
        }
        Y.prototype = {
          length: 0,
          item: function(s) {
            return this[s] || null;
          },
          toString: function(s, f) {
            for (var E = [], D = 0; D < this.length; D++)
              We(this[D], E, s, f);
            return E.join("");
          },
          filter: function(s) {
            return Array.prototype.filter.call(this, s);
          },
          indexOf: function(s) {
            return Array.prototype.indexOf.call(this, s);
          }
        };
        function ie(s, f) {
          this._node = s, this._refresh = f, le(this);
        }
        function le(s) {
          var f = s._node._inc || s._node.ownerDocument._inc;
          if (s._inc != f) {
            var E = s._refresh(s._node);
            tt(s, "length", E.length), H(E, s), s._inc = f;
          }
        }
        ie.prototype.item = function(s) {
          return le(this), this[s];
        }, G(ie, Y);
        function ue() {
        }
        function ee(s, f) {
          for (var E = s.length; E--; )
            if (s[E] === f)
              return E;
        }
        function de(s, f, E, D) {
          if (D ? f[ee(f, D)] = E : f[f.length++] = E, s) {
            E.ownerElement = s;
            var fe = s.ownerDocument;
            fe && (D && me(fe, s, D), ve(fe, s, E));
          }
        }
        function ae(s, f, E) {
          var D = ee(f, E);
          if (D >= 0) {
            for (var fe = f.length - 1; D < fe; )
              f[D] = f[++D];
            if (f.length = fe, s) {
              var Be = s.ownerDocument;
              Be && (me(Be, s, E), E.ownerElement = null);
            }
          } else
            throw new V(z, new Error(s.tagName + "@" + E));
        }
        ue.prototype = {
          length: 0,
          item: Y.prototype.item,
          getNamedItem: function(s) {
            for (var f = this.length; f--; ) {
              var E = this[f];
              if (E.nodeName == s)
                return E;
            }
          },
          setNamedItem: function(s) {
            var f = s.ownerElement;
            if (f && f != this._ownerElement)
              throw new V(q);
            var E = this.getNamedItem(s.nodeName);
            return de(this._ownerElement, this, s, E), E;
          },
          setNamedItemNS: function(s) {
            var f = s.ownerElement, E;
            if (f && f != this._ownerElement)
              throw new V(q);
            return E = this.getNamedItemNS(s.namespaceURI, s.localName), de(this._ownerElement, this, s, E), E;
          },
          removeNamedItem: function(s) {
            var f = this.getNamedItem(s);
            return ae(this._ownerElement, this, f), f;
          },
          removeNamedItemNS: function(s, f) {
            var E = this.getNamedItemNS(s, f);
            return ae(this._ownerElement, this, E), E;
          },
          getNamedItemNS: function(s, f) {
            for (var E = this.length; E--; ) {
              var D = this[E];
              if (D.localName == f && D.namespaceURI == s)
                return D;
            }
            return null;
          }
        };
        function Ce() {
        }
        Ce.prototype = {
          hasFeature: function(s, f) {
            return !0;
          },
          createDocument: function(s, f, E) {
            var D = new Se();
            if (D.implementation = this, D.childNodes = new Y(), D.doctype = E || null, E && D.appendChild(E), f) {
              var fe = D.createElementNS(s, f);
              D.appendChild(fe);
            }
            return D;
          },
          createDocumentType: function(s, f, E) {
            var D = new De();
            return D.name = s, D.nodeName = s, D.publicId = f || "", D.systemId = E || "", D;
          }
        };
        function J() {
        }
        J.prototype = {
          firstChild: null,
          lastChild: null,
          previousSibling: null,
          nextSibling: null,
          attributes: null,
          parentNode: null,
          childNodes: null,
          ownerDocument: null,
          nodeValue: null,
          namespaceURI: null,
          prefix: null,
          localName: null,
          insertBefore: function(s, f) {
            return u(this, s, f);
          },
          replaceChild: function(s, f) {
            u(this, s, f, c), f && this.removeChild(f);
          },
          removeChild: function(s) {
            return Ee(this, s);
          },
          appendChild: function(s) {
            return this.insertBefore(s, null);
          },
          hasChildNodes: function() {
            return this.firstChild != null;
          },
          cloneNode: function(s) {
            return rt(this.ownerDocument || this, this, s);
          },
          normalize: function() {
            for (var s = this.firstChild; s; ) {
              var f = s.nextSibling;
              f && f.nodeType == ne && s.nodeType == ne ? (this.removeChild(f), s.appendData(f.data)) : (s.normalize(), s = f);
            }
          },
          isSupported: function(s, f) {
            return this.ownerDocument.implementation.hasFeature(s, f);
          },
          hasAttributes: function() {
            return this.attributes.length > 0;
          },
          lookupPrefix: function(s) {
            for (var f = this; f; ) {
              var E = f._nsMap;
              if (E) {
                for (var D in E)
                  if (Object.prototype.hasOwnProperty.call(E, D) && E[D] === s)
                    return D;
              }
              f = f.nodeType == F ? f.ownerDocument : f.parentNode;
            }
            return null;
          },
          lookupNamespaceURI: function(s) {
            for (var f = this; f; ) {
              var E = f._nsMap;
              if (E && Object.prototype.hasOwnProperty.call(E, s))
                return E[s];
              f = f.nodeType == F ? f.ownerDocument : f.parentNode;
            }
            return null;
          },
          isDefaultNamespace: function(s) {
            var f = this.lookupPrefix(s);
            return f == null;
          }
        };
        function re(s) {
          return s == "<" && "&lt;" || s == ">" && "&gt;" || s == "&" && "&amp;" || s == '"' && "&quot;" || "&#" + s.charCodeAt() + ";";
        }
        H(X, J), H(X, J.prototype);
        function pe(s, f) {
          if (f(s))
            return !0;
          if (s = s.firstChild)
            do
              if (pe(s, f))
                return !0;
            while (s = s.nextSibling);
        }
        function Se() {
          this.ownerDocument = this;
        }
        function ve(s, f, E) {
          s && s._inc++;
          var D = E.namespaceURI;
          D === a.XMLNS && (f._nsMap[E.prefix ? E.localName : ""] = E.value);
        }
        function me(s, f, E, D) {
          s && s._inc++;
          var fe = E.namespaceURI;
          fe === a.XMLNS && delete f._nsMap[E.prefix ? E.localName : ""];
        }
        function Te(s, f, E) {
          if (s && s._inc) {
            s._inc++;
            var D = f.childNodes;
            if (E)
              D[D.length++] = E;
            else {
              for (var fe = f.firstChild, Be = 0; fe; )
                D[Be++] = fe, fe = fe.nextSibling;
              D.length = Be, delete D[D.length];
            }
          }
        }
        function Ee(s, f) {
          var E = f.previousSibling, D = f.nextSibling;
          return E ? E.nextSibling = D : s.firstChild = D, D ? D.previousSibling = E : s.lastChild = E, f.parentNode = null, f.previousSibling = null, f.nextSibling = null, Te(s.ownerDocument, s), f;
        }
        function be(s) {
          return s && (s.nodeType === J.DOCUMENT_NODE || s.nodeType === J.DOCUMENT_FRAGMENT_NODE || s.nodeType === J.ELEMENT_NODE);
        }
        function Ie(s) {
          return s && (Oe(s) || se(s) || Ae(s) || s.nodeType === J.DOCUMENT_FRAGMENT_NODE || s.nodeType === J.COMMENT_NODE || s.nodeType === J.PROCESSING_INSTRUCTION_NODE);
        }
        function Ae(s) {
          return s && s.nodeType === J.DOCUMENT_TYPE_NODE;
        }
        function Oe(s) {
          return s && s.nodeType === J.ELEMENT_NODE;
        }
        function se(s) {
          return s && s.nodeType === J.TEXT_NODE;
        }
        function b(s, f) {
          var E = s.childNodes || [];
          if (S(E, Oe) || Ae(f))
            return !1;
          var D = S(E, Ae);
          return !(f && D && E.indexOf(D) > E.indexOf(f));
        }
        function U(s, f) {
          var E = s.childNodes || [];
          function D(Be) {
            return Oe(Be) && Be !== f;
          }
          if (S(E, D))
            return !1;
          var fe = S(E, Ae);
          return !(f && fe && E.indexOf(fe) > E.indexOf(f));
        }
        function g(s, f, E) {
          if (!be(s))
            throw new V(w, "Unexpected parent node type " + s.nodeType);
          if (E && E.parentNode !== s)
            throw new V(z, "child not in parent");
          if (!Ie(f) || Ae(f) && s.nodeType !== J.DOCUMENT_NODE)
            throw new V(
              w,
              "Unexpected node type " + f.nodeType + " for parent node type " + s.nodeType
            );
        }
        function o(s, f, E) {
          var D = s.childNodes || [], fe = f.childNodes || [];
          if (f.nodeType === J.DOCUMENT_FRAGMENT_NODE) {
            var Be = fe.filter(Oe);
            if (Be.length > 1 || S(fe, se))
              throw new V(w, "More than one element or text in fragment");
            if (Be.length === 1 && !b(s, E))
              throw new V(w, "Element in fragment can not be inserted before doctype");
          }
          if (Oe(f) && !b(s, E))
            throw new V(w, "Only one element can be added and only after doctype");
          if (Ae(f)) {
            if (S(D, Ae))
              throw new V(w, "Only one doctype is allowed");
            var Me = S(D, Oe);
            if (E && D.indexOf(Me) < D.indexOf(E))
              throw new V(w, "Doctype can only be inserted before an element");
            if (!E && Me)
              throw new V(w, "Doctype can not be appended since element is present");
          }
        }
        function c(s, f, E) {
          var D = s.childNodes || [], fe = f.childNodes || [];
          if (f.nodeType === J.DOCUMENT_FRAGMENT_NODE) {
            var Be = fe.filter(Oe);
            if (Be.length > 1 || S(fe, se))
              throw new V(w, "More than one element or text in fragment");
            if (Be.length === 1 && !U(s, E))
              throw new V(w, "Element in fragment can not be inserted before doctype");
          }
          if (Oe(f) && !U(s, E))
            throw new V(w, "Only one element can be added and only after doctype");
          if (Ae(f)) {
            if (S(D, function(Qe) {
              return Ae(Qe) && Qe !== E;
            }))
              throw new V(w, "Only one doctype is allowed");
            var Me = S(D, Oe);
            if (E && D.indexOf(Me) < D.indexOf(E))
              throw new V(w, "Doctype can only be inserted before an element");
          }
        }
        function u(s, f, E, D) {
          g(s, f, E), s.nodeType === J.DOCUMENT_NODE && (D || o)(s, f, E);
          var fe = f.parentNode;
          if (fe && fe.removeChild(f), f.nodeType === M) {
            var Be = f.firstChild;
            if (Be == null)
              return f;
            var Me = f.lastChild;
          } else
            Be = Me = f;
          var ce = E ? E.previousSibling : s.lastChild;
          Be.previousSibling = ce, Me.nextSibling = E, ce ? ce.nextSibling = Be : s.firstChild = Be, E == null ? s.lastChild = Me : E.previousSibling = Me;
          do
            Be.parentNode = s;
          while (Be !== Me && (Be = Be.nextSibling));
          return Te(s.ownerDocument || s, s), f.nodeType == M && (f.firstChild = f.lastChild = null), f;
        }
        function v(s, f) {
          return f.parentNode && f.parentNode.removeChild(f), f.parentNode = s, f.previousSibling = s.lastChild, f.nextSibling = null, f.previousSibling ? f.previousSibling.nextSibling = f : s.firstChild = f, s.lastChild = f, Te(s.ownerDocument, s, f), f;
        }
        Se.prototype = {
          nodeName: "#document",
          nodeType: Q,
          doctype: null,
          documentElement: null,
          _inc: 1,
          insertBefore: function(s, f) {
            if (s.nodeType == M) {
              for (var E = s.firstChild; E; ) {
                var D = E.nextSibling;
                this.insertBefore(E, f), E = D;
              }
              return s;
            }
            return u(this, s, f), s.ownerDocument = this, this.documentElement === null && s.nodeType === N && (this.documentElement = s), s;
          },
          removeChild: function(s) {
            return this.documentElement == s && (this.documentElement = null), Ee(this, s);
          },
          replaceChild: function(s, f) {
            u(this, s, f, c), s.ownerDocument = this, f && this.removeChild(f), Oe(s) && (this.documentElement = s);
          },
          importNode: function(s, f) {
            return st(this, s, f);
          },
          getElementById: function(s) {
            var f = null;
            return pe(this.documentElement, function(E) {
              if (E.nodeType == N && E.getAttribute("id") == s)
                return f = E, !0;
            }), f;
          },
          getElementsByClassName: function(s) {
            var f = A(s);
            return new ie(this, function(E) {
              var D = [];
              return f.length > 0 && pe(E.documentElement, function(fe) {
                if (fe !== E && fe.nodeType === N) {
                  var Be = fe.getAttribute("class");
                  if (Be) {
                    var Me = s === Be;
                    if (!Me) {
                      var ce = A(Be);
                      Me = f.every(B(ce));
                    }
                    Me && D.push(fe);
                  }
                }
              }), D;
            });
          },
          createElement: function(s) {
            var f = new R();
            f.ownerDocument = this, f.nodeName = s, f.tagName = s, f.localName = s, f.childNodes = new Y();
            var E = f.attributes = new ue();
            return E._ownerElement = f, f;
          },
          createDocumentFragment: function() {
            var s = new Ke();
            return s.ownerDocument = this, s.childNodes = new Y(), s;
          },
          createTextNode: function(s) {
            var f = new ge();
            return f.ownerDocument = this, f.appendData(s), f;
          },
          createComment: function(s) {
            var f = new ye();
            return f.ownerDocument = this, f.appendData(s), f;
          },
          createCDATASection: function(s) {
            var f = new te();
            return f.ownerDocument = this, f.appendData(s), f;
          },
          createProcessingInstruction: function(s, f) {
            var E = new qe();
            return E.ownerDocument = this, E.tagName = E.target = s, E.nodeValue = E.data = f, E;
          },
          createAttribute: function(s) {
            var f = new I();
            return f.ownerDocument = this, f.name = s, f.nodeName = s, f.localName = s, f.specified = !0, f;
          },
          createEntityReference: function(s) {
            var f = new Fe();
            return f.ownerDocument = this, f.nodeName = s, f;
          },
          createElementNS: function(s, f) {
            var E = new R(), D = f.split(":"), fe = E.attributes = new ue();
            return E.childNodes = new Y(), E.ownerDocument = this, E.nodeName = f, E.tagName = f, E.namespaceURI = s, D.length == 2 ? (E.prefix = D[0], E.localName = D[1]) : E.localName = f, fe._ownerElement = E, E;
          },
          createAttributeNS: function(s, f) {
            var E = new I(), D = f.split(":");
            return E.ownerDocument = this, E.nodeName = f, E.name = f, E.namespaceURI = s, E.specified = !0, D.length == 2 ? (E.prefix = D[0], E.localName = D[1]) : E.localName = f, E;
          }
        }, G(Se, J);
        function R() {
          this._nsMap = {};
        }
        R.prototype = {
          nodeType: N,
          hasAttribute: function(s) {
            return this.getAttributeNode(s) != null;
          },
          getAttribute: function(s) {
            var f = this.getAttributeNode(s);
            return f && f.value || "";
          },
          getAttributeNode: function(s) {
            return this.attributes.getNamedItem(s);
          },
          setAttribute: function(s, f) {
            var E = this.ownerDocument.createAttribute(s);
            E.value = E.nodeValue = "" + f, this.setAttributeNode(E);
          },
          removeAttribute: function(s) {
            var f = this.getAttributeNode(s);
            f && this.removeAttributeNode(f);
          },
          appendChild: function(s) {
            return s.nodeType === M ? this.insertBefore(s, null) : v(this, s);
          },
          setAttributeNode: function(s) {
            return this.attributes.setNamedItem(s);
          },
          setAttributeNodeNS: function(s) {
            return this.attributes.setNamedItemNS(s);
          },
          removeAttributeNode: function(s) {
            return this.attributes.removeNamedItem(s.nodeName);
          },
          removeAttributeNS: function(s, f) {
            var E = this.getAttributeNodeNS(s, f);
            E && this.removeAttributeNode(E);
          },
          hasAttributeNS: function(s, f) {
            return this.getAttributeNodeNS(s, f) != null;
          },
          getAttributeNS: function(s, f) {
            var E = this.getAttributeNodeNS(s, f);
            return E && E.value || "";
          },
          setAttributeNS: function(s, f, E) {
            var D = this.ownerDocument.createAttributeNS(s, f);
            D.value = D.nodeValue = "" + E, this.setAttributeNode(D);
          },
          getAttributeNodeNS: function(s, f) {
            return this.attributes.getNamedItemNS(s, f);
          },
          getElementsByTagName: function(s) {
            return new ie(this, function(f) {
              var E = [];
              return pe(f, function(D) {
                D !== f && D.nodeType == N && (s === "*" || D.tagName == s) && E.push(D);
              }), E;
            });
          },
          getElementsByTagNameNS: function(s, f) {
            return new ie(this, function(E) {
              var D = [];
              return pe(E, function(fe) {
                fe !== E && fe.nodeType === N && (s === "*" || fe.namespaceURI === s) && (f === "*" || fe.localName == f) && D.push(fe);
              }), D;
            });
          }
        }, Se.prototype.getElementsByTagName = R.prototype.getElementsByTagName, Se.prototype.getElementsByTagNameNS = R.prototype.getElementsByTagNameNS, G(R, J);
        function I() {
        }
        I.prototype.nodeType = F, G(I, J);
        function Z() {
        }
        Z.prototype = {
          data: "",
          substringData: function(s, f) {
            return this.data.substring(s, s + f);
          },
          appendData: function(s) {
            s = this.data + s, this.nodeValue = this.data = s, this.length = s.length;
          },
          insertData: function(s, f) {
            this.replaceData(s, 0, f);
          },
          appendChild: function(s) {
            throw new Error(oe[w]);
          },
          deleteData: function(s, f) {
            this.replaceData(s, f, "");
          },
          replaceData: function(s, f, E) {
            var D = this.data.substring(0, s), fe = this.data.substring(s + f);
            E = D + E + fe, this.nodeValue = this.data = E, this.length = E.length;
          }
        }, G(Z, J);
        function ge() {
        }
        ge.prototype = {
          nodeName: "#text",
          nodeType: ne,
          splitText: function(s) {
            var f = this.data, E = f.substring(s);
            f = f.substring(0, s), this.data = this.nodeValue = f, this.length = f.length;
            var D = this.ownerDocument.createTextNode(E);
            return this.parentNode && this.parentNode.insertBefore(D, this.nextSibling), D;
          }
        }, G(ge, Z);
        function ye() {
        }
        ye.prototype = {
          nodeName: "#comment",
          nodeType: y
        }, G(ye, Z);
        function te() {
        }
        te.prototype = {
          nodeName: "#cdata-section",
          nodeType: W
        }, G(te, Z);
        function De() {
        }
        De.prototype.nodeType = p, G(De, J);
        function xe() {
        }
        xe.prototype.nodeType = j, G(xe, J);
        function Ne() {
        }
        Ne.prototype.nodeType = _, G(Ne, J);
        function Fe() {
        }
        Fe.prototype.nodeType = he, G(Fe, J);
        function Ke() {
        }
        Ke.prototype.nodeName = "#document-fragment", Ke.prototype.nodeType = M, G(Ke, J);
        function qe() {
        }
        qe.prototype.nodeType = T, G(qe, J);
        function Xe() {
        }
        Xe.prototype.serializeToString = function(s, f, E) {
          return Ge.call(s, f, E);
        }, J.prototype.toString = Ge;
        function Ge(s, f) {
          var E = [], D = this.nodeType == 9 && this.documentElement || this, fe = D.prefix, Be = D.namespaceURI;
          if (Be && fe == null) {
            var fe = D.lookupPrefix(Be);
            if (fe == null)
              var Me = [
                { namespace: Be, prefix: null }
              ];
          }
          return We(this, E, s, f, Me), E.join("");
        }
        function ze(s, f, E) {
          var D = s.prefix || "", fe = s.namespaceURI;
          if (!fe || D === "xml" && fe === a.XML || fe === a.XMLNS)
            return !1;
          for (var Be = E.length; Be--; ) {
            var Me = E[Be];
            if (Me.prefix === D)
              return Me.namespace !== fe;
          }
          return !0;
        }
        function Ve(s, f, E) {
          s.push(" ", f, '="', E.replace(/[<>&"\t\n\r]/g, re), '"');
        }
        function We(s, f, E, D, fe) {
          if (fe || (fe = []), D)
            if (s = D(s), s) {
              if (typeof s == "string") {
                f.push(s);
                return;
              }
            } else
              return;
          switch (s.nodeType) {
            case N:
              var Be = s.attributes, Me = Be.length, x = s.firstChild, ce = s.tagName;
              E = a.isHTML(s.namespaceURI) || E;
              var Qe = ce;
              if (!E && !s.prefix && s.namespaceURI) {
                for (var Je, $e = 0; $e < Be.length; $e++)
                  if (Be.item($e).name === "xmlns") {
                    Je = Be.item($e).value;
                    break;
                  }
                if (!Je)
                  for (var e = fe.length - 1; e >= 0; e--) {
                    var h = fe[e];
                    if (h.prefix === "" && h.namespace === s.namespaceURI) {
                      Je = h.namespace;
                      break;
                    }
                  }
                if (Je !== s.namespaceURI)
                  for (var e = fe.length - 1; e >= 0; e--) {
                    var h = fe[e];
                    if (h.namespace === s.namespaceURI) {
                      h.prefix && (Qe = h.prefix + ":" + ce);
                      break;
                    }
                  }
              }
              f.push("<", Qe);
              for (var t = 0; t < Me; t++) {
                var l = Be.item(t);
                l.prefix == "xmlns" ? fe.push({ prefix: l.localName, namespace: l.value }) : l.nodeName == "xmlns" && fe.push({ prefix: "", namespace: l.value });
              }
              for (var t = 0; t < Me; t++) {
                var l = Be.item(t);
                if (ze(l, E, fe)) {
                  var C = l.prefix || "", m = l.namespaceURI;
                  Ve(f, C ? "xmlns:" + C : "xmlns", m), fe.push({ prefix: C, namespace: m });
                }
                We(l, f, E, D, fe);
              }
              if (ce === Qe && ze(s, E, fe)) {
                var C = s.prefix || "", m = s.namespaceURI;
                Ve(f, C ? "xmlns:" + C : "xmlns", m), fe.push({ prefix: C, namespace: m });
              }
              if (x || E && !/^(?:meta|link|img|br|hr|input)$/i.test(ce)) {
                if (f.push(">"), E && /^script$/i.test(ce))
                  for (; x; )
                    x.data ? f.push(x.data) : We(x, f, E, D, fe.slice()), x = x.nextSibling;
                else
                  for (; x; )
                    We(x, f, E, D, fe.slice()), x = x.nextSibling;
                f.push("</", Qe, ">");
              } else
                f.push("/>");
              return;
            case Q:
            case M:
              for (var x = s.firstChild; x; )
                We(x, f, E, D, fe.slice()), x = x.nextSibling;
              return;
            case F:
              return Ve(f, s.name, s.value);
            case ne:
              return f.push(
                s.data.replace(/[<&>]/g, re)
              );
            case W:
              return f.push("<![CDATA[", s.data, "]]>");
            case y:
              return f.push("<!--", s.data, "-->");
            case p:
              var O = s.publicId, $ = s.systemId;
              if (f.push("<!DOCTYPE ", s.name), O)
                f.push(" PUBLIC ", O), $ && $ != "." && f.push(" ", $), f.push(">");
              else if ($ && $ != ".")
                f.push(" SYSTEM ", $, ">");
              else {
                var _e = s.internalSubset;
                _e && f.push(" [", _e, "]"), f.push(">");
              }
              return;
            case T:
              return f.push("<?", s.target, " ", s.data, "?>");
            case he:
              return f.push("&", s.nodeName, ";");
            default:
              f.push("??", s.nodeName);
          }
        }
        function st(s, f, E) {
          var D;
          switch (f.nodeType) {
            case N:
              D = f.cloneNode(!1), D.ownerDocument = s;
            case M:
              break;
            case F:
              E = !0;
              break;
          }
          if (D || (D = f.cloneNode(!1)), D.ownerDocument = s, D.parentNode = null, E)
            for (var fe = f.firstChild; fe; )
              D.appendChild(st(s, fe, E)), fe = fe.nextSibling;
          return D;
        }
        function rt(s, f, E) {
          var D = new f.constructor();
          for (var fe in f)
            if (Object.prototype.hasOwnProperty.call(f, fe)) {
              var Be = f[fe];
              typeof Be != "object" && Be != D[fe] && (D[fe] = Be);
            }
          switch (f.childNodes && (D.childNodes = new Y()), D.ownerDocument = s, D.nodeType) {
            case N:
              var Me = f.attributes, ce = D.attributes = new ue(), Qe = Me.length;
              ce._ownerElement = D;
              for (var Je = 0; Je < Qe; Je++)
                D.setAttributeNode(rt(s, Me.item(Je), !0));
              break;
            case F:
              E = !0;
          }
          if (E)
            for (var $e = f.firstChild; $e; )
              D.appendChild(rt(s, $e, E)), $e = $e.nextSibling;
          return D;
        }
        function tt(s, f, E) {
          s[f] = E;
        }
        try {
          if (Object.defineProperty) {
            let s = function(f) {
              switch (f.nodeType) {
                case N:
                case M:
                  var E = [];
                  for (f = f.firstChild; f; )
                    f.nodeType !== 7 && f.nodeType !== 8 && E.push(s(f)), f = f.nextSibling;
                  return E.join("");
                default:
                  return f.nodeValue;
              }
            };
            Object.defineProperty(ie.prototype, "length", {
              get: function() {
                return le(this), this.$$length;
              }
            }), Object.defineProperty(J.prototype, "textContent", {
              get: function() {
                return s(this);
              },
              set: function(f) {
                switch (this.nodeType) {
                  case N:
                  case M:
                    for (; this.firstChild; )
                      this.removeChild(this.firstChild);
                    (f || String(f)) && this.appendChild(this.ownerDocument.createTextNode(f));
                    break;
                  default:
                    this.data = f, this.value = f, this.nodeValue = f;
                }
              }
            }), tt = function(f, E, D) {
              f["$$" + E] = D;
            };
          }
        } catch {
        }
        i.DocumentType = De, i.DOMException = V, i.DOMImplementation = Ce, i.Element = R, i.Node = J, i.NodeList = Y, i.XMLSerializer = Xe;
      },
      "./node_modules/@xmldom/xmldom/lib/entities.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;
        i.XML_ENTITIES = d({ amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' }), i.HTML_ENTITIES = d({
          lt: "<",
          gt: ">",
          amp: "&",
          quot: '"',
          apos: "'",
          Agrave: "\xC0",
          Aacute: "\xC1",
          Acirc: "\xC2",
          Atilde: "\xC3",
          Auml: "\xC4",
          Aring: "\xC5",
          AElig: "\xC6",
          Ccedil: "\xC7",
          Egrave: "\xC8",
          Eacute: "\xC9",
          Ecirc: "\xCA",
          Euml: "\xCB",
          Igrave: "\xCC",
          Iacute: "\xCD",
          Icirc: "\xCE",
          Iuml: "\xCF",
          ETH: "\xD0",
          Ntilde: "\xD1",
          Ograve: "\xD2",
          Oacute: "\xD3",
          Ocirc: "\xD4",
          Otilde: "\xD5",
          Ouml: "\xD6",
          Oslash: "\xD8",
          Ugrave: "\xD9",
          Uacute: "\xDA",
          Ucirc: "\xDB",
          Uuml: "\xDC",
          Yacute: "\xDD",
          THORN: "\xDE",
          szlig: "\xDF",
          agrave: "\xE0",
          aacute: "\xE1",
          acirc: "\xE2",
          atilde: "\xE3",
          auml: "\xE4",
          aring: "\xE5",
          aelig: "\xE6",
          ccedil: "\xE7",
          egrave: "\xE8",
          eacute: "\xE9",
          ecirc: "\xEA",
          euml: "\xEB",
          igrave: "\xEC",
          iacute: "\xED",
          icirc: "\xEE",
          iuml: "\xEF",
          eth: "\xF0",
          ntilde: "\xF1",
          ograve: "\xF2",
          oacute: "\xF3",
          ocirc: "\xF4",
          otilde: "\xF5",
          ouml: "\xF6",
          oslash: "\xF8",
          ugrave: "\xF9",
          uacute: "\xFA",
          ucirc: "\xFB",
          uuml: "\xFC",
          yacute: "\xFD",
          thorn: "\xFE",
          yuml: "\xFF",
          nbsp: "\xA0",
          iexcl: "\xA1",
          cent: "\xA2",
          pound: "\xA3",
          curren: "\xA4",
          yen: "\xA5",
          brvbar: "\xA6",
          sect: "\xA7",
          uml: "\xA8",
          copy: "\xA9",
          ordf: "\xAA",
          laquo: "\xAB",
          not: "\xAC",
          shy: "\xAD\xAD",
          reg: "\xAE",
          macr: "\xAF",
          deg: "\xB0",
          plusmn: "\xB1",
          sup2: "\xB2",
          sup3: "\xB3",
          acute: "\xB4",
          micro: "\xB5",
          para: "\xB6",
          middot: "\xB7",
          cedil: "\xB8",
          sup1: "\xB9",
          ordm: "\xBA",
          raquo: "\xBB",
          frac14: "\xBC",
          frac12: "\xBD",
          frac34: "\xBE",
          iquest: "\xBF",
          times: "\xD7",
          divide: "\xF7",
          forall: "\u2200",
          part: "\u2202",
          exist: "\u2203",
          empty: "\u2205",
          nabla: "\u2207",
          isin: "\u2208",
          notin: "\u2209",
          ni: "\u220B",
          prod: "\u220F",
          sum: "\u2211",
          minus: "\u2212",
          lowast: "\u2217",
          radic: "\u221A",
          prop: "\u221D",
          infin: "\u221E",
          ang: "\u2220",
          and: "\u2227",
          or: "\u2228",
          cap: "\u2229",
          cup: "\u222A",
          int: "\u222B",
          there4: "\u2234",
          sim: "\u223C",
          cong: "\u2245",
          asymp: "\u2248",
          ne: "\u2260",
          equiv: "\u2261",
          le: "\u2264",
          ge: "\u2265",
          sub: "\u2282",
          sup: "\u2283",
          nsub: "\u2284",
          sube: "\u2286",
          supe: "\u2287",
          oplus: "\u2295",
          otimes: "\u2297",
          perp: "\u22A5",
          sdot: "\u22C5",
          Alpha: "\u0391",
          Beta: "\u0392",
          Gamma: "\u0393",
          Delta: "\u0394",
          Epsilon: "\u0395",
          Zeta: "\u0396",
          Eta: "\u0397",
          Theta: "\u0398",
          Iota: "\u0399",
          Kappa: "\u039A",
          Lambda: "\u039B",
          Mu: "\u039C",
          Nu: "\u039D",
          Xi: "\u039E",
          Omicron: "\u039F",
          Pi: "\u03A0",
          Rho: "\u03A1",
          Sigma: "\u03A3",
          Tau: "\u03A4",
          Upsilon: "\u03A5",
          Phi: "\u03A6",
          Chi: "\u03A7",
          Psi: "\u03A8",
          Omega: "\u03A9",
          alpha: "\u03B1",
          beta: "\u03B2",
          gamma: "\u03B3",
          delta: "\u03B4",
          epsilon: "\u03B5",
          zeta: "\u03B6",
          eta: "\u03B7",
          theta: "\u03B8",
          iota: "\u03B9",
          kappa: "\u03BA",
          lambda: "\u03BB",
          mu: "\u03BC",
          nu: "\u03BD",
          xi: "\u03BE",
          omicron: "\u03BF",
          pi: "\u03C0",
          rho: "\u03C1",
          sigmaf: "\u03C2",
          sigma: "\u03C3",
          tau: "\u03C4",
          upsilon: "\u03C5",
          phi: "\u03C6",
          chi: "\u03C7",
          psi: "\u03C8",
          omega: "\u03C9",
          thetasym: "\u03D1",
          upsih: "\u03D2",
          piv: "\u03D6",
          OElig: "\u0152",
          oelig: "\u0153",
          Scaron: "\u0160",
          scaron: "\u0161",
          Yuml: "\u0178",
          fnof: "\u0192",
          circ: "\u02C6",
          tilde: "\u02DC",
          ensp: "\u2002",
          emsp: "\u2003",
          thinsp: "\u2009",
          zwnj: "\u200C",
          zwj: "\u200D",
          lrm: "\u200E",
          rlm: "\u200F",
          ndash: "\u2013",
          mdash: "\u2014",
          lsquo: "\u2018",
          rsquo: "\u2019",
          sbquo: "\u201A",
          ldquo: "\u201C",
          rdquo: "\u201D",
          bdquo: "\u201E",
          dagger: "\u2020",
          Dagger: "\u2021",
          bull: "\u2022",
          hellip: "\u2026",
          permil: "\u2030",
          prime: "\u2032",
          Prime: "\u2033",
          lsaquo: "\u2039",
          rsaquo: "\u203A",
          oline: "\u203E",
          euro: "\u20AC",
          trade: "\u2122",
          larr: "\u2190",
          uarr: "\u2191",
          rarr: "\u2192",
          darr: "\u2193",
          harr: "\u2194",
          crarr: "\u21B5",
          lceil: "\u2308",
          rceil: "\u2309",
          lfloor: "\u230A",
          rfloor: "\u230B",
          loz: "\u25CA",
          spades: "\u2660",
          clubs: "\u2663",
          hearts: "\u2665",
          diams: "\u2666"
        }), i.entityMap = i.HTML_ENTITIES;
      },
      "./node_modules/@xmldom/xmldom/lib/index.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/dom.js");
        i.DOMImplementation = d.DOMImplementation, i.XMLSerializer = d.XMLSerializer, i.DOMParser = n("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser;
      },
      "./node_modules/@xmldom/xmldom/lib/sax.js": function(r, i, n) {
        var d = n("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE, S = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, a = new RegExp("[\\-\\.0-9" + S.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"), k = new RegExp("^" + S.source + a.source + "*(?::" + S.source + a.source + "*)?$"), P = 0, L = 1, A = 2, B = 3, H = 4, G = 5, X = 6, N = 7;
        function F(w, z) {
          this.message = w, this.locator = z, Error.captureStackTrace && Error.captureStackTrace(this, F);
        }
        F.prototype = new Error(), F.prototype.name = F.name;
        function ne() {
        }
        ne.prototype = {
          parse: function(w, z, q) {
            var V = this.domBuilder;
            V.startDocument(), p(z, z = {}), W(
              w,
              z,
              q,
              V,
              this.errorHandler
            ), V.endDocument();
          }
        };
        function W(w, z, q, V, Y) {
          function ie(R) {
            if (R > 65535) {
              R -= 65536;
              var I = 55296 + (R >> 10), Z = 56320 + (R & 1023);
              return String.fromCharCode(I, Z);
            } else
              return String.fromCharCode(R);
          }
          function le(R) {
            var I = R.slice(1, -1);
            return Object.hasOwnProperty.call(q, I) ? q[I] : I.charAt(0) === "#" ? ie(parseInt(I.substr(1).replace("x", "0x"))) : (Y.error("entity not found:" + R), R);
          }
          function ue(R) {
            if (R > Se) {
              var I = w.substring(Se, R).replace(/&#?\w+;/g, le);
              J && ee(Se), V.characters(I, 0, R - Se), Se = R;
            }
          }
          function ee(R, I) {
            for (; R >= ae && (I = Ce.exec(w)); )
              de = I.index, ae = de + I[0].length, J.lineNumber++;
            J.columnNumber = R - de + 1;
          }
          for (var de = 0, ae = 0, Ce = /.*(?:\r\n?|\n)|.*$/g, J = V.locator, re = [{ currentNSMap: z }], pe = {}, Se = 0; ; ) {
            try {
              var ve = w.indexOf("<", Se);
              if (ve < 0) {
                if (!w.substr(Se).match(/^\s*$/)) {
                  var me = V.doc, Te = me.createTextNode(w.substr(Se));
                  me.appendChild(Te), V.currentElement = Te;
                }
                return;
              }
              switch (ve > Se && ue(ve), w.charAt(ve + 1)) {
                case "/":
                  var g = w.indexOf(">", ve + 3), Ee = w.substring(ve + 2, g).replace(/[ \t\n\r]+$/g, ""), be = re.pop();
                  g < 0 ? (Ee = w.substring(ve + 2).replace(/[\s<].*/, ""), Y.error("end tag name: " + Ee + " is not complete:" + be.tagName), g = ve + 1 + Ee.length) : Ee.match(/\s</) && (Ee = Ee.replace(/[\s<].*/, ""), Y.error("end tag name: " + Ee + " maybe not complete"), g = ve + 1 + Ee.length);
                  var Ie = be.localNSMap, Ae = be.tagName == Ee, Oe = Ae || be.tagName && be.tagName.toLowerCase() == Ee.toLowerCase();
                  if (Oe) {
                    if (V.endElement(be.uri, be.localName, Ee), Ie)
                      for (var se in Ie)
                        Object.prototype.hasOwnProperty.call(Ie, se) && V.endPrefixMapping(se);
                    Ae || Y.fatalError("end tag name: " + Ee + " is not match the current start tagName:" + be.tagName);
                  } else
                    re.push(be);
                  g++;
                  break;
                case "?":
                  J && ee(ve), g = j(w, ve, V);
                  break;
                case "!":
                  J && ee(ve), g = M(w, ve, V, Y);
                  break;
                default:
                  J && ee(ve);
                  var b = new K(), U = re[re.length - 1].currentNSMap, g = _(w, ve, b, U, le, Y), o = b.length;
                  if (!b.closed && Q(w, g, b.tagName, pe) && (b.closed = !0, q.nbsp || Y.warning("unclosed xml attribute")), J && o) {
                    for (var c = he(J, {}), u = 0; u < o; u++) {
                      var v = b[u];
                      ee(v.offset), v.locator = he(J, {});
                    }
                    V.locator = c, T(b, V, U) && re.push(b), V.locator = J;
                  } else
                    T(b, V, U) && re.push(b);
                  d.isHTML(b.uri) && !b.closed ? g = y(w, g, b.tagName, le, V) : g++;
              }
            } catch (R) {
              if (R instanceof F)
                throw R;
              Y.error("element parse error: " + R), g = -1;
            }
            g > Se ? Se = g : ue(Math.max(ve, Se) + 1);
          }
        }
        function he(w, z) {
          return z.lineNumber = w.lineNumber, z.columnNumber = w.columnNumber, z;
        }
        function _(w, z, q, V, Y, ie) {
          function le(J, re, pe) {
            q.attributeNames.hasOwnProperty(J) && ie.fatalError("Attribute " + J + " redefined"), q.addValue(
              J,
              re.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, Y),
              pe
            );
          }
          for (var ue, ee, de = ++z, ae = P; ; ) {
            var Ce = w.charAt(de);
            switch (Ce) {
              case "=":
                if (ae === L)
                  ue = w.slice(z, de), ae = B;
                else if (ae === A)
                  ae = B;
                else
                  throw new Error("attribute equal must after attrName");
                break;
              case "'":
              case '"':
                if (ae === B || ae === L)
                  if (ae === L && (ie.warning('attribute value must after "="'), ue = w.slice(z, de)), z = de + 1, de = w.indexOf(Ce, z), de > 0)
                    ee = w.slice(z, de), le(ue, ee, z - 1), ae = G;
                  else
                    throw new Error("attribute value no end '" + Ce + "' match");
                else if (ae == H)
                  ee = w.slice(z, de), le(ue, ee, z), ie.warning('attribute "' + ue + '" missed start quot(' + Ce + ")!!"), z = de + 1, ae = G;
                else
                  throw new Error('attribute value must after "="');
                break;
              case "/":
                switch (ae) {
                  case P:
                    q.setTagName(w.slice(z, de));
                  case G:
                  case X:
                  case N:
                    ae = N, q.closed = !0;
                  case H:
                  case L:
                  case A:
                    break;
                  default:
                    throw new Error("attribute invalid close char('/')");
                }
                break;
              case "":
                return ie.error("unexpected end of input"), ae == P && q.setTagName(w.slice(z, de)), de;
              case ">":
                switch (ae) {
                  case P:
                    q.setTagName(w.slice(z, de));
                  case G:
                  case X:
                  case N:
                    break;
                  case H:
                  case L:
                    ee = w.slice(z, de), ee.slice(-1) === "/" && (q.closed = !0, ee = ee.slice(0, -1));
                  case A:
                    ae === A && (ee = ue), ae == H ? (ie.warning('attribute "' + ee + '" missed quot(")!'), le(ue, ee, z)) : ((!d.isHTML(V[""]) || !ee.match(/^(?:disabled|checked|selected)$/i)) && ie.warning('attribute "' + ee + '" missed value!! "' + ee + '" instead!!'), le(ee, ee, z));
                    break;
                  case B:
                    throw new Error("attribute value missed!!");
                }
                return de;
              case "\x80":
                Ce = " ";
              default:
                if (Ce <= " ")
                  switch (ae) {
                    case P:
                      q.setTagName(w.slice(z, de)), ae = X;
                      break;
                    case L:
                      ue = w.slice(z, de), ae = A;
                      break;
                    case H:
                      var ee = w.slice(z, de);
                      ie.warning('attribute "' + ee + '" missed quot(")!!'), le(ue, ee, z);
                    case G:
                      ae = X;
                      break;
                  }
                else
                  switch (ae) {
                    case A:
                      q.tagName, (!d.isHTML(V[""]) || !ue.match(/^(?:disabled|checked|selected)$/i)) && ie.warning('attribute "' + ue + '" missed value!! "' + ue + '" instead2!!'), le(ue, ue, z), z = de, ae = L;
                      break;
                    case G:
                      ie.warning('attribute space is required"' + ue + '"!!');
                    case X:
                      ae = L, z = de;
                      break;
                    case B:
                      ae = H, z = de;
                      break;
                    case N:
                      throw new Error("elements closed character '/' and '>' must be connected to");
                  }
            }
            de++;
          }
        }
        function T(w, z, q) {
          for (var V = w.tagName, Y = null, Ce = w.length; Ce--; ) {
            var ie = w[Ce], le = ie.qName, ue = ie.value, J = le.indexOf(":");
            if (J > 0)
              var ee = ie.prefix = le.slice(0, J), de = le.slice(J + 1), ae = ee === "xmlns" && de;
            else
              de = le, ee = null, ae = le === "xmlns" && "";
            ie.localName = de, ae !== !1 && (Y == null && (Y = {}, p(q, q = {})), q[ae] = Y[ae] = ue, ie.uri = d.XMLNS, z.startPrefixMapping(ae, ue));
          }
          for (var Ce = w.length; Ce--; ) {
            ie = w[Ce];
            var ee = ie.prefix;
            ee && (ee === "xml" && (ie.uri = d.XML), ee !== "xmlns" && (ie.uri = q[ee || ""]));
          }
          var J = V.indexOf(":");
          J > 0 ? (ee = w.prefix = V.slice(0, J), de = w.localName = V.slice(J + 1)) : (ee = null, de = w.localName = V);
          var re = w.uri = q[ee || ""];
          if (z.startElement(re, de, V, w), w.closed) {
            if (z.endElement(re, de, V), Y)
              for (ee in Y)
                Object.prototype.hasOwnProperty.call(Y, ee) && z.endPrefixMapping(ee);
          } else
            return w.currentNSMap = q, w.localNSMap = Y, !0;
        }
        function y(w, z, q, V, Y) {
          if (/^(?:script|textarea)$/i.test(q)) {
            var ie = w.indexOf("</" + q + ">", z), le = w.substring(z + 1, ie);
            if (/[&<]/.test(le))
              return /^script$/i.test(q) ? (Y.characters(le, 0, le.length), ie) : (le = le.replace(/&#?\w+;/g, V), Y.characters(le, 0, le.length), ie);
          }
          return z + 1;
        }
        function Q(w, z, q, V) {
          var Y = V[q];
          return Y == null && (Y = w.lastIndexOf("</" + q + ">"), Y < z && (Y = w.lastIndexOf("</" + q)), V[q] = Y), Y < z;
        }
        function p(w, z) {
          for (var q in w)
            Object.prototype.hasOwnProperty.call(w, q) && (z[q] = w[q]);
        }
        function M(w, z, q, V) {
          var Y = w.charAt(z + 2);
          switch (Y) {
            case "-":
              if (w.charAt(z + 3) === "-") {
                var ie = w.indexOf("-->", z + 4);
                return ie > z ? (q.comment(w, z + 4, ie - z - 4), ie + 3) : (V.error("Unclosed comment"), -1);
              } else
                return -1;
            default:
              if (w.substr(z + 3, 6) == "CDATA[") {
                var ie = w.indexOf("]]>", z + 9);
                return q.startCDATA(), q.characters(w, z + 9, ie - z - 9), q.endCDATA(), ie + 3;
              }
              var le = oe(w, z), ue = le.length;
              if (ue > 1 && /!doctype/i.test(le[0][0])) {
                var ee = le[1][0], de = !1, ae = !1;
                ue > 3 && (/^public$/i.test(le[2][0]) ? (de = le[3][0], ae = ue > 4 && le[4][0]) : /^system$/i.test(le[2][0]) && (ae = le[3][0]));
                var Ce = le[ue - 1];
                return q.startDTD(ee, de, ae), q.endDTD(), Ce.index + Ce[0].length;
              }
          }
          return -1;
        }
        function j(w, z, q) {
          var V = w.indexOf("?>", z);
          if (V) {
            var Y = w.substring(z, V).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
            return Y ? (Y[0].length, q.processingInstruction(Y[1], Y[2]), V + 2) : -1;
          }
          return -1;
        }
        function K() {
          this.attributeNames = {};
        }
        K.prototype = {
          setTagName: function(w) {
            if (!k.test(w))
              throw new Error("invalid tagName:" + w);
            this.tagName = w;
          },
          addValue: function(w, z, q) {
            if (!k.test(w))
              throw new Error("invalid attribute:" + w);
            this.attributeNames[w] = this.length, this[this.length++] = { qName: w, value: z, offset: q };
          },
          length: 0,
          getLocalName: function(w) {
            return this[w].localName;
          },
          getLocator: function(w) {
            return this[w].locator;
          },
          getQName: function(w) {
            return this[w].qName;
          },
          getURI: function(w) {
            return this[w].uri;
          },
          getValue: function(w) {
            return this[w].value;
          }
        };
        function oe(w, z) {
          var q, V = [], Y = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
          for (Y.lastIndex = z, Y.exec(w); q = Y.exec(w); )
            if (V.push(q), q[1])
              return V;
        }
        i.XMLReader = ne, i.ParseError = F;
      },
      "./node_modules/process/browser.js": function(r, i) {
        var n = r.exports = {}, d, S;
        function a() {
          throw new Error("setTimeout has not been defined");
        }
        function k() {
          throw new Error("clearTimeout has not been defined");
        }
        (function() {
          try {
            typeof setTimeout == "function" ? d = setTimeout : d = a;
          } catch {
            d = a;
          }
          try {
            typeof clearTimeout == "function" ? S = clearTimeout : S = k;
          } catch {
            S = k;
          }
        })();
        function P(W) {
          if (d === setTimeout)
            return setTimeout(W, 0);
          if ((d === a || !d) && setTimeout)
            return d = setTimeout, setTimeout(W, 0);
          try {
            return d(W, 0);
          } catch {
            try {
              return d.call(null, W, 0);
            } catch {
              return d.call(this, W, 0);
            }
          }
        }
        function L(W) {
          if (S === clearTimeout)
            return clearTimeout(W);
          if ((S === k || !S) && clearTimeout)
            return S = clearTimeout, clearTimeout(W);
          try {
            return S(W);
          } catch {
            try {
              return S.call(null, W);
            } catch {
              return S.call(this, W);
            }
          }
        }
        var A = [], B = !1, H, G = -1;
        function X() {
          !B || !H || (B = !1, H.length ? A = H.concat(A) : G = -1, A.length && N());
        }
        function N() {
          if (!B) {
            var W = P(X);
            B = !0;
            for (var he = A.length; he; ) {
              for (H = A, A = []; ++G < he; )
                H && H[G].run();
              G = -1, he = A.length;
            }
            H = null, B = !1, L(W);
          }
        }
        n.nextTick = function(W) {
          var he = new Array(arguments.length - 1);
          if (arguments.length > 1)
            for (var _ = 1; _ < arguments.length; _++)
              he[_ - 1] = arguments[_];
          A.push(new F(W, he)), A.length === 1 && !B && P(N);
        };
        function F(W, he) {
          this.fun = W, this.array = he;
        }
        F.prototype.run = function() {
          this.fun.apply(null, this.array);
        }, n.title = "browser", n.browser = !0, n.env = {}, n.argv = [], n.version = "", n.versions = {};
        function ne() {
        }
        n.on = ne, n.addListener = ne, n.once = ne, n.off = ne, n.removeListener = ne, n.removeAllListeners = ne, n.emit = ne, n.prependListener = ne, n.prependOnceListener = ne, n.listeners = function(W) {
          return [];
        }, n.binding = function(W) {
          throw new Error("process.binding is not supported");
        }, n.cwd = function() {
          return "/";
        }, n.chdir = function(W) {
          throw new Error("process.chdir is not supported");
        }, n.umask = function() {
          return 0;
        };
      },
      "./node_modules/webpack/buildin/amd-options.js": function(r, i) {
        (function(n) {
          r.exports = n;
        }).call(this, {});
      },
      "./node_modules/webpack/buildin/global.js": function(r, i) {
        var n;
        n = function() {
          return this;
        }();
        try {
          n = n || new Function("return this")();
        } catch {
          typeof window == "object" && (n = window);
        }
        r.exports = n;
      },
      "./node_modules/webpack/buildin/module.js": function(r, i) {
        r.exports = function(n) {
          return n.webpackPolyfill || (n.deprecate = function() {
          }, n.paths = [], n.children || (n.children = []), Object.defineProperty(n, "loaded", {
            enumerable: !0,
            get: function() {
              return n.l;
            }
          }), Object.defineProperty(n, "id", {
            enumerable: !0,
            get: function() {
              return n.i;
            }
          }), n.webpackPolyfill = 1), n;
        };
      },
      "./package.json": function(r) {
        r.exports = JSON.parse('{"name":"cos-js-sdk-v5","version":"1.4.18","description":"JavaScript SDK for [\u817E\u8BAF\u4E91\u5BF9\u8C61\u5B58\u50A8](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js test/test.js server/sts.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"@xmldom/xmldom":"^0.8.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"2.8.8","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}');
      },
      "./src/advance.js": function(r, i, n) {
        var d = n("./node_modules/@babel/runtime/helpers/typeof.js"), S = n("./src/session.js"), a = n("./src/async.js"), k = n("./src/event.js").EventProxy, P = n("./src/util.js"), L = n("./src/tracker.js");
        function A(p, M) {
          var j = this, K = new k(), oe = p.TaskId, w = p.Bucket, z = p.Region, q = p.Key, V = p.Body, Y = p.ChunkSize || p.SliceSize || j.options.ChunkSize, ie = p.AsyncLimit, le = p.StorageClass, ue = p.ServerSideEncryption, ee, de, ae = p.onHashProgress, Ce = p.tracker;
          Ce && Ce.setParams({
            chunkSize: Y
          }), K.on("error", function(J) {
            if (!!j._isRunningTask(oe))
              return J.UploadId = p.UploadData.UploadId || "", M(J);
          }), K.on("upload_complete", function(J) {
            var re = P.extend({
              UploadId: p.UploadData.UploadId || ""
            }, J);
            M(null, re);
          }), K.on("upload_slice_complete", function(J) {
            var re = {};
            P.each(p.Headers, function(pe, Se) {
              var ve = Se.toLowerCase();
              (ve.indexOf("x-cos-meta-") === 0 || ve === "pic-operations") && (re[Se] = pe);
            }), F.call(j, {
              Bucket: w,
              Region: z,
              Key: q,
              UploadId: J.UploadId,
              SliceList: J.SliceList,
              Headers: re,
              tracker: Ce
            }, function(pe, Se) {
              if (!!j._isRunningTask(oe)) {
                if (S.removeUsing(J.UploadId), pe)
                  return de(null, !0), K.emit("error", pe);
                S.removeUploadId.call(j, J.UploadId), de({
                  loaded: ee,
                  total: ee
                }, !0), K.emit("upload_complete", Se);
              }
            });
          }), K.on("get_upload_data_finish", function(J) {
            var re = S.getFileId(V, p.ChunkSize, w, q);
            re && S.saveUploadId.call(j, re, J.UploadId, j.options.UploadIdCacheLimit), S.setUsing(J.UploadId), de(null, !0), X.call(j, {
              TaskId: oe,
              Bucket: w,
              Region: z,
              Key: q,
              Body: V,
              FileSize: ee,
              SliceSize: Y,
              AsyncLimit: ie,
              ServerSideEncryption: ue,
              UploadData: J,
              Headers: p.Headers,
              onProgress: de,
              tracker: Ce
            }, function(pe, Se) {
              if (!!j._isRunningTask(oe)) {
                if (pe)
                  return de(null, !0), K.emit("error", pe);
                K.emit("upload_slice_complete", Se);
              }
            });
          }), K.on("get_file_size_finish", function() {
            if (de = P.throttleOnProgress.call(j, ee, p.onProgress), p.UploadData.UploadId)
              K.emit("get_upload_data_finish", p.UploadData);
            else {
              var J = P.extend({
                TaskId: oe,
                Bucket: w,
                Region: z,
                Key: q,
                Headers: p.Headers,
                StorageClass: le,
                Body: V,
                FileSize: ee,
                SliceSize: Y,
                onHashProgress: ae,
                tracker: Ce
              }, p);
              B.call(j, J, function(re, pe) {
                if (!!j._isRunningTask(oe)) {
                  if (re)
                    return K.emit("error", re);
                  p.UploadData.UploadId = pe.UploadId, p.UploadData.PartList = pe.PartList, K.emit("get_upload_data_finish", p.UploadData);
                }
              });
            }
          }), ee = p.ContentLength, delete p.ContentLength, !p.Headers && (p.Headers = {}), P.each(p.Headers, function(J, re) {
            re.toLowerCase() === "content-length" && delete p.Headers[re];
          }), function() {
            for (var J = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], re = 1024 * 1024, pe = 0; pe < J.length && (re = J[pe] * 1024 * 1024, !(ee / re <= j.options.MaxPartNumber)); pe++)
              ;
            p.ChunkSize = p.SliceSize = Y = Math.max(Y, re);
          }(), ee === 0 ? (p.Body = "", p.ContentLength = 0, p.SkipTask = !0, j.putObject(p, M)) : K.emit("get_file_size_finish");
        }
        function B(p, M) {
          var j = p.TaskId, K = p.Bucket, oe = p.Region, w = p.Key, z = p.StorageClass, q = this, V = {}, Y = p.FileSize, ie = p.SliceSize, le = Math.ceil(Y / ie), ue = 0, ee = P.throttleOnProgress.call(q, Y, p.onHashProgress), de = function(re, pe) {
            var Se = ie * (re - 1), ve = Math.min(Se + ie, Y), me = ve - Se;
            V[re] ? pe(null, {
              PartNumber: re,
              ETag: V[re],
              Size: me
            }) : P.fileSlice(p.Body, Se, ve, !1, function(Te) {
              P.getFileMd5(Te, function(Ee, be) {
                if (Ee)
                  return pe(P.error(Ee));
                var Ie = '"' + be + '"';
                V[re] = Ie, ue += me, ee({
                  loaded: ue,
                  total: Y
                }), pe(null, {
                  PartNumber: re,
                  ETag: Ie,
                  Size: me
                });
              });
            });
          }, ae = function(re, pe) {
            var Se = re.length;
            if (Se === 0)
              return pe(null, !0);
            if (Se > le)
              return pe(null, !1);
            if (Se > 1) {
              var ve = Math.max(re[0].Size, re[1].Size);
              if (ve !== ie)
                return pe(null, !1);
            }
            var me = function Te(Ee) {
              if (Ee < Se) {
                var be = re[Ee];
                de(be.PartNumber, function(Ie, Ae) {
                  Ae && Ae.ETag === be.ETag && Ae.Size === be.Size ? Te(Ee + 1) : pe(null, !1);
                });
              } else
                pe(null, !0);
            };
            me(0);
          }, Ce = new k();
          Ce.on("error", function(J) {
            if (!!q._isRunningTask(j))
              return M(J);
          }), Ce.on("upload_id_available", function(J) {
            var re = {}, pe = [];
            P.each(J.PartList, function(me) {
              re[me.PartNumber] = me;
            });
            for (var Se = 1; Se <= le; Se++) {
              var ve = re[Se];
              ve ? (ve.PartNumber = Se, ve.Uploaded = !0) : ve = {
                PartNumber: Se,
                ETag: null,
                Uploaded: !1
              }, pe.push(ve);
            }
            J.PartList = pe, M(null, J);
          }), Ce.on("no_available_upload_id", function() {
            if (!!q._isRunningTask(j)) {
              var J = P.extend({
                Bucket: K,
                Region: oe,
                Key: w,
                Query: P.clone(p.Query),
                StorageClass: z,
                Body: p.Body,
                calledBySdk: "sliceUploadFile",
                tracker: p.tracker
              }, p), re = P.clone(p.Headers);
              delete re["x-cos-mime-limit"], J.Headers = re, q.multipartInit(J, function(pe, Se) {
                if (!!q._isRunningTask(j)) {
                  if (pe)
                    return Ce.emit("error", pe);
                  var ve = Se.UploadId;
                  if (!ve)
                    return M(P.error(new Error("no such upload id")));
                  Ce.emit("upload_id_available", {
                    UploadId: ve,
                    PartList: []
                  });
                }
              });
            }
          }), Ce.on("has_and_check_upload_id", function(J) {
            J = J.reverse(), a.eachLimit(J, 1, function(re, pe) {
              if (!!q._isRunningTask(j)) {
                if (S.using[re]) {
                  pe();
                  return;
                }
                G.call(q, {
                  Bucket: K,
                  Region: oe,
                  Key: w,
                  UploadId: re,
                  tracker: p.tracker
                }, function(Se, ve) {
                  if (!!q._isRunningTask(j)) {
                    if (Se)
                      return S.removeUsing(re), Ce.emit("error", Se);
                    var me = ve.PartList;
                    me.forEach(function(Te) {
                      Te.PartNumber *= 1, Te.Size *= 1, Te.ETag = Te.ETag || "";
                    }), ae(me, function(Te, Ee) {
                      if (!!q._isRunningTask(j)) {
                        if (Te)
                          return Ce.emit("error", Te);
                        Ee ? pe({
                          UploadId: re,
                          PartList: me
                        }) : pe();
                      }
                    });
                  }
                });
              }
            }, function(re) {
              !q._isRunningTask(j) || (ee(null, !0), re && re.UploadId ? Ce.emit("upload_id_available", re) : Ce.emit("no_available_upload_id"));
            });
          }), Ce.on("seek_local_avail_upload_id", function(J) {
            var re = S.getFileId(p.Body, p.ChunkSize, K, w), pe = S.getUploadIdList.call(q, re);
            if (!re || !pe) {
              Ce.emit("has_and_check_upload_id", J);
              return;
            }
            var Se = function ve(me) {
              if (me >= pe.length) {
                Ce.emit("has_and_check_upload_id", J);
                return;
              }
              var Te = pe[me];
              if (!P.isInArray(J, Te)) {
                S.removeUploadId.call(q, Te), ve(me + 1);
                return;
              }
              if (S.using[Te]) {
                ve(me + 1);
                return;
              }
              G.call(q, {
                Bucket: K,
                Region: oe,
                Key: w,
                UploadId: Te,
                tracker: p.tracker
              }, function(Ee, be) {
                !q._isRunningTask(j) || (Ee ? (S.removeUploadId.call(q, Te), ve(me + 1)) : Ce.emit("upload_id_available", {
                  UploadId: Te,
                  PartList: be.PartList
                }));
              });
            };
            Se(0);
          }), Ce.on("get_remote_upload_id_list", function() {
            H.call(q, {
              Bucket: K,
              Region: oe,
              Key: w,
              tracker: p.tracker
            }, function(J, re) {
              if (!!q._isRunningTask(j)) {
                if (J)
                  return Ce.emit("error", J);
                var pe = P.filter(re.UploadList, function(me) {
                  return me.Key === w && (!z || me.StorageClass.toUpperCase() === z.toUpperCase());
                }).reverse().map(function(me) {
                  return me.UploadId || me.UploadID;
                });
                if (pe.length)
                  Ce.emit("seek_local_avail_upload_id", pe);
                else {
                  var Se = S.getFileId(p.Body, p.ChunkSize, K, w), ve;
                  Se && (ve = S.getUploadIdList.call(q, Se)) && P.each(ve, function(me) {
                    S.removeUploadId.call(q, me);
                  }), Ce.emit("no_available_upload_id");
                }
              }
            });
          }), Ce.emit("get_remote_upload_id_list");
        }
        function H(p, M) {
          var j = this, K = [], oe = {
            Bucket: p.Bucket,
            Region: p.Region,
            Prefix: p.Key,
            calledBySdk: p.calledBySdk || "sliceUploadFile",
            tracker: p.tracker
          }, w = function z() {
            j.multipartList(oe, function(q, V) {
              if (q)
                return M(q);
              K.push.apply(K, V.Upload || []), V.IsTruncated === "true" ? (oe.KeyMarker = V.NextKeyMarker, oe.UploadIdMarker = V.NextUploadIdMarker, z()) : M(null, {
                UploadList: K
              });
            });
          };
          w();
        }
        function G(p, M) {
          var j = this, K = [], oe = {
            Bucket: p.Bucket,
            Region: p.Region,
            Key: p.Key,
            UploadId: p.UploadId,
            calledBySdk: "sliceUploadFile",
            tracker: p.tracker
          }, w = function z() {
            j.multipartListPart(oe, function(q, V) {
              if (q)
                return M(q);
              K.push.apply(K, V.Part || []), V.IsTruncated === "true" ? (oe.PartNumberMarker = V.NextPartNumberMarker, z()) : M(null, {
                PartList: K
              });
            });
          };
          w();
        }
        function X(p, M) {
          var j = this, K = p.TaskId, oe = p.Bucket, w = p.Region, z = p.Key, q = p.UploadData, V = p.FileSize, Y = p.SliceSize, ie = Math.min(p.AsyncLimit || j.options.ChunkParallelLimit || 1, 256), le = p.Body, ue = Math.ceil(V / Y), ee = 0, de = p.ServerSideEncryption, ae = p.Headers, Ce = P.filter(q.PartList, function(re) {
            return re.Uploaded && (ee += re.PartNumber >= ue && V % Y || Y), !re.Uploaded;
          }), J = p.onProgress;
          a.eachLimit(Ce, ie, function(re, pe) {
            if (!!j._isRunningTask(K)) {
              var Se = re.PartNumber, ve = Math.min(V, re.PartNumber * Y) - (re.PartNumber - 1) * Y, me = 0;
              N.call(j, {
                TaskId: K,
                Bucket: oe,
                Region: w,
                Key: z,
                SliceSize: Y,
                FileSize: V,
                PartNumber: Se,
                ServerSideEncryption: de,
                Body: le,
                UploadData: q,
                Headers: ae,
                onProgress: function(Ee) {
                  ee += Ee.loaded - me, me = Ee.loaded, J({
                    loaded: ee,
                    total: V
                  });
                },
                tracker: p.tracker
              }, function(Te, Ee) {
                !j._isRunningTask(K) || (!Te && !Ee.ETag && (Te = 'get ETag error, please add "ETag" to CORS ExposeHeader setting.( \u83B7\u53D6ETag\u5931\u8D25\uFF0C\u8BF7\u5728CORS ExposeHeader\u8BBE\u7F6E\u4E2D\u6DFB\u52A0ETag\uFF0C\u8BF7\u53C2\u8003\u6587\u6863\uFF1Ahttps://cloud.tencent.com/document/product/436/13318 )'), Te ? ee -= me : (ee += ve - me, re.ETag = Ee.ETag), J({
                  loaded: ee,
                  total: V
                }), pe(Te || null, Ee));
              });
            }
          }, function(re) {
            if (!!j._isRunningTask(K)) {
              if (re)
                return M(re);
              M(null, {
                UploadId: q.UploadId,
                SliceList: q.PartList
              });
            }
          });
        }
        function N(p, M) {
          var j = this, K = p.TaskId, oe = p.Bucket, w = p.Region, z = p.Key, q = p.FileSize, V = p.Body, Y = p.PartNumber * 1, ie = p.SliceSize, le = p.ServerSideEncryption, ue = p.UploadData, ee = p.Headers || {}, de = j.options.ChunkRetryTimes + 1, ae = ie * (Y - 1), Ce = ie, J = ae + ie;
          J > q && (J = q, Ce = J - ae);
          var re = ["x-cos-traffic-limit", "x-cos-mime-limit"], pe = {};
          P.each(ee, function(ve, me) {
            re.indexOf(me) > -1 && (pe[me] = ve);
          });
          var Se = ue.PartList[Y - 1];
          a.retry(de, function(ve) {
            !j._isRunningTask(K) || P.fileSlice(V, ae, J, !0, function(me) {
              j.multipartUpload({
                TaskId: K,
                Bucket: oe,
                Region: w,
                Key: z,
                ContentLength: Ce,
                PartNumber: Y,
                UploadId: ue.UploadId,
                ServerSideEncryption: le,
                Body: me,
                Headers: pe,
                onProgress: p.onProgress,
                calledBySdk: "sliceUploadFile",
                tracker: p.tracker
              }, function(Te, Ee) {
                if (!!j._isRunningTask(K))
                  return Te ? ve(Te) : (Se.Uploaded = !0, ve(null, Ee));
              });
            });
          }, function(ve, me) {
            if (!!j._isRunningTask(K))
              return M(ve, me);
          });
        }
        function F(p, M) {
          var j = p.Bucket, K = p.Region, oe = p.Key, w = p.UploadId, z = p.SliceList, q = this, V = this.options.ChunkRetryTimes + 1, Y = p.Headers, ie = z.map(function(le) {
            return {
              PartNumber: le.PartNumber,
              ETag: le.ETag
            };
          });
          a.retry(V, function(le) {
            q.multipartComplete({
              Bucket: j,
              Region: K,
              Key: oe,
              UploadId: w,
              Parts: ie,
              Headers: Y,
              calledBySdk: "sliceUploadFile",
              tracker: p.tracker
            }, le);
          }, function(le, ue) {
            M(le, ue);
          });
        }
        function ne(p, M) {
          var j = p.Bucket, K = p.Region, oe = p.Key, w = p.UploadId, z = p.Level || "task", q = p.AsyncLimit, V = this, Y = new k();
          if (Y.on("error", function(ie) {
            return M(ie);
          }), Y.on("get_abort_array", function(ie) {
            W.call(V, {
              Bucket: j,
              Region: K,
              Key: oe,
              Headers: p.Headers,
              AsyncLimit: q,
              AbortArray: ie
            }, M);
          }), z === "bucket")
            H.call(V, {
              Bucket: j,
              Region: K,
              calledBySdk: "abortUploadTask"
            }, function(ie, le) {
              if (ie)
                return M(ie);
              Y.emit("get_abort_array", le.UploadList || []);
            });
          else if (z === "file") {
            if (!oe)
              return M(P.error(new Error("abort_upload_task_no_key")));
            H.call(V, {
              Bucket: j,
              Region: K,
              Key: oe,
              calledBySdk: "abortUploadTask"
            }, function(ie, le) {
              if (ie)
                return M(ie);
              Y.emit("get_abort_array", le.UploadList || []);
            });
          } else if (z === "task") {
            if (!w)
              return M(P.error(new Error("abort_upload_task_no_id")));
            if (!oe)
              return M(P.error(new Error("abort_upload_task_no_key")));
            Y.emit("get_abort_array", [{
              Key: oe,
              UploadId: w
            }]);
          } else
            return M(P.error(new Error("abort_unknown_level")));
        }
        function W(p, M) {
          var j = p.Bucket, K = p.Region, oe = p.Key, w = p.AbortArray, z = p.AsyncLimit || 1, q = this, V = 0, Y = new Array(w.length);
          a.eachLimit(w, z, function(ie, le) {
            var ue = V;
            if (oe && oe !== ie.Key) {
              Y[ue] = {
                error: {
                  KeyNotMatch: !0
                }
              }, le(null);
              return;
            }
            var ee = ie.UploadId || ie.UploadID;
            q.multipartAbort({
              Bucket: j,
              Region: K,
              Key: ie.Key,
              Headers: p.Headers,
              UploadId: ee
            }, function(de) {
              var ae = {
                Bucket: j,
                Region: K,
                Key: ie.Key,
                UploadId: ee
              };
              Y[ue] = {
                error: de,
                task: ae
              }, le(null);
            }), V++;
          }, function(ie) {
            if (ie)
              return M(ie);
            for (var le = [], ue = [], ee = 0, de = Y.length; ee < de; ee++) {
              var ae = Y[ee];
              ae.task && (ae.error ? ue.push(ae.task) : le.push(ae.task));
            }
            return M(null, {
              successList: le,
              errorList: ue
            });
          });
        }
        function he(p, M) {
          var j = this, K = p.SliceSize === void 0 ? j.options.SliceSize : p.SliceSize, oe = [], w = p.Body, z = w.size || w.length || 0, q = {
            TaskId: ""
          };
          if (j.options.EnableTracker) {
            var V = j.options.UseAccelerate || typeof j.options.Domain == "string" && j.options.Domain.includes("accelerate.");
            p.tracker = new L({
              bucket: p.Bucket,
              region: p.Region,
              apiName: "uploadFile",
              fileKey: p.Key,
              fileSize: z,
              accelerate: V,
              deepTracker: j.options.DeepTracker,
              customId: j.options.CustomId,
              delay: j.options.TrackerDelay
            });
          }
          P.each(p, function(de, ae) {
            d(de) !== "object" && typeof de != "function" && (q[ae] = de);
          });
          var Y = p.onTaskReady, ie = function(ae) {
            q.TaskId = ae, Y && Y(ae);
          };
          p.onTaskReady = ie;
          var le = z > K ? "sliceUploadFile" : "putObject", ue = p.onFileFinish, ee = function(ae, Ce) {
            p.tracker && p.tracker.formatResult(ae, Ce), ue && ue(ae, Ce, q), M && M(ae, Ce);
          };
          oe.push({
            api: le,
            params: p,
            callback: ee
          }), j._addTasks(oe);
        }
        function _(p, M) {
          var j = this, K = p.SliceSize === void 0 ? j.options.SliceSize : p.SliceSize, oe = 0, w = 0, z = P.throttleOnProgress.call(j, w, p.onProgress), q = p.files.length, V = p.onFileFinish, Y = Array(q), ie = function(ee, de, ae) {
            z(null, !0), V && V(ee, de, ae), Y[ae.Index] = {
              options: ae,
              error: ee,
              data: de
            }, --q <= 0 && M && M(null, {
              files: Y
            });
          }, le = [];
          P.each(p.files, function(ue, ee) {
            (function() {
              var de = ue.Body, ae = de.size || de.length || 0, Ce = {
                Index: ee,
                TaskId: ""
              };
              if (oe += ae, j.options.EnableTracker) {
                var J = j.options.UseAccelerate || typeof j.options.Domain == "string" && j.options.Domain.includes("accelerate.");
                ue.tracker = new L({
                  bucket: ue.Bucket,
                  region: ue.Region,
                  apiName: "uploadFiles",
                  fileKey: ue.Key,
                  fileSize: ae,
                  accelerate: J,
                  deepTracker: j.options.DeepTracker,
                  customId: j.options.CustomId,
                  delay: j.options.TrackerDelay
                });
              }
              P.each(ue, function(Ie, Ae) {
                d(Ie) !== "object" && typeof Ie != "function" && (Ce[Ae] = Ie);
              });
              var re = ue.onTaskReady, pe = function(Ae) {
                Ce.TaskId = Ae, re && re(Ae);
              };
              ue.onTaskReady = pe;
              var Se = 0, ve = ue.onProgress, me = function(Ae) {
                w = w - Se + Ae.loaded, Se = Ae.loaded, ve && ve(Ae), z({
                  loaded: w,
                  total: oe
                });
              };
              ue.onProgress = me;
              var Te = ae > K ? "sliceUploadFile" : "putObject", Ee = ue.onFileFinish, be = function(Ae, Oe) {
                ue.tracker && ue.tracker.formatResult(Ae, Oe), Ee && Ee(Ae, Oe), ie && ie(Ae, Oe, Ce);
              };
              le.push({
                api: Te,
                params: ue,
                callback: be
              });
            })();
          }), j._addTasks(le);
        }
        function T(p, M) {
          var j = new k(), K = this, oe = p.Bucket, w = p.Region, z = p.Key, q = p.CopySource, V = P.getSourceParams.call(this, q);
          if (!V) {
            M(P.error(new Error("CopySource format error")));
            return;
          }
          var Y = V.Bucket, ie = V.Region, le = decodeURIComponent(V.Key), ue = p.CopySliceSize === void 0 ? K.options.CopySliceSize : p.CopySliceSize;
          ue = Math.max(0, ue);
          var ee = p.CopyChunkSize || this.options.CopyChunkSize, de = this.options.CopyChunkParallelLimit, ae = this.options.ChunkRetryTimes + 1, Ce = 0, J = 0, re, pe, Se = {}, ve = {}, me = {};
          j.on("copy_slice_complete", function(Te) {
            P.each(p.Headers, function(be, Ie) {
              Ie.toLowerCase().indexOf("x-cos-meta-");
            });
            var Ee = P.map(Te.PartList, function(be) {
              return {
                PartNumber: be.PartNumber,
                ETag: be.ETag
              };
            });
            a.retry(ae, function(be) {
              K.multipartComplete({
                Bucket: oe,
                Region: w,
                Key: z,
                UploadId: Te.UploadId,
                Parts: Ee,
                calledBySdk: "sliceCopyFile"
              }, be);
            }, function(be, Ie) {
              if (S.removeUsing(Te.UploadId), be)
                return pe(null, !0), M(be);
              S.removeUploadId(Te.UploadId), pe({
                loaded: re,
                total: re
              }, !0), M(null, Ie);
            });
          }), j.on("get_copy_data_finish", function(Te) {
            var Ee = S.getCopyFileId(q, Se, ee, oe, z);
            Ee && S.saveUploadId(Ee, Te.UploadId, K.options.UploadIdCacheLimit), S.setUsing(Te.UploadId);
            var be = P.filter(Te.PartList, function(Ie) {
              return Ie.Uploaded && (J += Ie.PartNumber >= Ce && re % ee || ee), !Ie.Uploaded;
            });
            a.eachLimit(be, de, function(Ie, Ae) {
              var Oe = Ie.PartNumber, se = Ie.CopySourceRange, b = Ie.end - Ie.start;
              a.retry(ae, function(U) {
                y.call(K, {
                  Bucket: oe,
                  Region: w,
                  Key: z,
                  CopySource: q,
                  UploadId: Te.UploadId,
                  PartNumber: Oe,
                  CopySourceRange: se
                }, U);
              }, function(U, g) {
                if (U)
                  return Ae(U);
                J += b, pe({
                  loaded: J,
                  total: re
                }), Ie.ETag = g.ETag, Ae(U || null, g);
              });
            }, function(Ie) {
              if (Ie)
                return S.removeUsing(Te.UploadId), pe(null, !0), M(Ie);
              j.emit("copy_slice_complete", Te);
            });
          }), j.on("get_chunk_size_finish", function() {
            var Te = function() {
              K.multipartInit({
                Bucket: oe,
                Region: w,
                Key: z,
                Headers: me
              }, function(Oe, se) {
                if (Oe)
                  return M(Oe);
                p.UploadId = se.UploadId, j.emit("get_copy_data_finish", {
                  UploadId: p.UploadId,
                  PartList: p.PartList
                });
              });
            }, Ee = S.getCopyFileId(q, Se, ee, oe, z), be = S.getUploadIdList(Ee);
            if (!Ee || !be)
              return Te();
            var Ie = function Ae(Oe) {
              if (Oe >= be.length)
                return Te();
              var se = be[Oe];
              if (S.using[se])
                return Ae(Oe + 1);
              G.call(K, {
                Bucket: oe,
                Region: w,
                Key: z,
                UploadId: se
              }, function(b, U) {
                if (b)
                  S.removeUploadId(se), Ae(Oe + 1);
                else {
                  if (S.using[se])
                    return Ae(Oe + 1);
                  var g = {}, o = 0;
                  P.each(U.PartList, function(c) {
                    var u = parseInt(c.Size), v = o + u - 1;
                    g[c.PartNumber + "|" + o + "|" + v] = c.ETag, o += u;
                  }), P.each(p.PartList, function(c) {
                    var u = g[c.PartNumber + "|" + c.start + "|" + c.end];
                    u && (c.ETag = u, c.Uploaded = !0);
                  }), j.emit("get_copy_data_finish", {
                    UploadId: se,
                    PartList: p.PartList
                  });
                }
              });
            };
            Ie(0);
          }), j.on("get_file_size_finish", function() {
            if (function() {
              for (var Ee = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 5120], be = 1024 * 1024, Ie = 0; Ie < Ee.length && (be = Ee[Ie] * 1024 * 1024, !(re / be <= K.options.MaxPartNumber)); Ie++)
                ;
              p.ChunkSize = ee = Math.max(ee, be), Ce = Math.ceil(re / ee);
              for (var Ae = [], Oe = 1; Oe <= Ce; Oe++) {
                var se = (Oe - 1) * ee, b = Oe * ee < re ? Oe * ee - 1 : re - 1, U = {
                  PartNumber: Oe,
                  start: se,
                  end: b,
                  CopySourceRange: "bytes=" + se + "-" + b
                };
                Ae.push(U);
              }
              p.PartList = Ae;
            }(), p.Headers["x-cos-metadata-directive"] === "Replaced" ? me = p.Headers : me = ve, me["x-cos-storage-class"] = p.Headers["x-cos-storage-class"] || ve["x-cos-storage-class"], me = P.clearKey(me), ve["x-cos-storage-class"] === "ARCHIVE" || ve["x-cos-storage-class"] === "DEEP_ARCHIVE") {
              var Te = ve["x-cos-restore"];
              if (!Te || Te === 'ongoing-request="true"') {
                M(P.error(new Error("Unrestored archive object is not allowed to be copied")));
                return;
              }
            }
            delete me["x-cos-copy-source"], delete me["x-cos-metadata-directive"], delete me["x-cos-copy-source-If-Modified-Since"], delete me["x-cos-copy-source-If-Unmodified-Since"], delete me["x-cos-copy-source-If-Match"], delete me["x-cos-copy-source-If-None-Match"], j.emit("get_chunk_size_finish");
          }), K.headObject({
            Bucket: Y,
            Region: ie,
            Key: le
          }, function(Te, Ee) {
            if (Te) {
              Te.statusCode && Te.statusCode === 404 ? M(P.error(Te, {
                ErrorStatus: le + " Not Exist"
              })) : M(Te);
              return;
            }
            if (re = p.FileSize = Ee.headers["content-length"], re === void 0 || !re) {
              M(P.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.\uFF08 \u83B7\u53D6Content-Length\u5931\u8D25\uFF0C\u8BF7\u5728CORS ExposeHeader\u8BBE\u7F6E\u4E2D\u6DFB\u52A0Content-Length\uFF0C\u8BF7\u53C2\u8003\u6587\u6863\uFF1Ahttps://cloud.tencent.com/document/product/436/13318 \uFF09')));
              return;
            }
            if (pe = P.throttleOnProgress.call(K, re, p.onProgress), re <= ue)
              p.Headers["x-cos-metadata-directive"] || (p.Headers["x-cos-metadata-directive"] = "Copy"), K.putObjectCopy(p, function(Ie, Ae) {
                if (Ie)
                  return pe(null, !0), M(Ie);
                pe({
                  loaded: re,
                  total: re
                }, !0), M(Ie, Ae);
              });
            else {
              var be = Ee.headers;
              Se = be, ve = {
                "Cache-Control": be["cache-control"],
                "Content-Disposition": be["content-disposition"],
                "Content-Encoding": be["content-encoding"],
                "Content-Type": be["content-type"],
                Expires: be.expires,
                "x-cos-storage-class": be["x-cos-storage-class"]
              }, P.each(be, function(Ie, Ae) {
                var Oe = "x-cos-meta-";
                Ae.indexOf(Oe) === 0 && Ae.length > Oe.length && (ve[Ae] = Ie);
              }), j.emit("get_file_size_finish");
            }
          });
        }
        function y(p, M) {
          var j = p.TaskId, K = p.Bucket, oe = p.Region, w = p.Key, z = p.CopySource, q = p.UploadId, V = p.PartNumber * 1, Y = p.CopySourceRange, ie = this.options.ChunkRetryTimes + 1, le = this;
          a.retry(ie, function(ue) {
            le.uploadPartCopy({
              TaskId: j,
              Bucket: K,
              Region: oe,
              Key: w,
              CopySource: z,
              UploadId: q,
              PartNumber: V,
              CopySourceRange: Y
            }, function(ee, de) {
              ue(ee || null, de);
            });
          }, function(ue, ee) {
            return M(ue, ee);
          });
        }
        var Q = {
          sliceUploadFile: A,
          abortUploadTask: ne,
          uploadFile: he,
          uploadFiles: _,
          sliceCopyFile: T
        };
        r.exports.init = function(p, M) {
          M.transferToTaskMethod(Q, "sliceUploadFile"), P.each(Q, function(j, K) {
            p.prototype[K] = P.apiWrapper(K, j);
          });
        };
      },
      "./src/async.js": function(r, i) {
        var n = function(k, P, L, A) {
          if (A = A || function() {
          }, !k.length || P <= 0)
            return A();
          var B = 0, H = 0, G = 0;
          (function X() {
            if (B >= k.length)
              return A();
            for (; G < P && H < k.length; )
              H += 1, G += 1, L(k[H - 1], function(N) {
                N ? (A(N), A = function() {
                }) : (B += 1, G -= 1, B >= k.length ? A() : X());
              });
          })();
        }, d = function(k, P, L) {
          var A = function B(H) {
            P(function(G, X) {
              G && H < k ? B(H + 1) : L(G, X);
            });
          };
          k < 1 ? L() : A(1);
        }, S = {
          eachLimit: n,
          retry: d
        };
        r.exports = S;
      },
      "./src/base.js": function(r, i, n) {
        var d = n("./node_modules/@babel/runtime/helpers/typeof.js"), S = n("./lib/request.js"), a = n("./src/util.js");
        function k(e, h) {
          typeof e == "function" && (h = e, e = {});
          var t = this.options.Protocol || (a.isBrowser && (typeof location > "u" ? "undefined" : d(location)) === "object" && location.protocol === "http:" ? "http:" : "https:"), l = this.options.ServiceDomain, C = e.AppId || this.options.appId, m = e.Region;
          l ? (l = l.replace(/\{\{AppId\}\}/gi, C || "").replace(/\{\{Region\}\}/gi, m || "").replace(/\{\{.*?\}\}/gi, ""), /^[a-zA-Z]+:\/\//.test(l) || (l = t + "//" + l), l.slice(-1) === "/" && (l = l.slice(0, -1))) : m ? l = t + "//cos." + m + ".myqcloud.com" : l = t + "//service.cos.myqcloud.com";
          var x = "", O = m ? "cos." + m + ".myqcloud.com" : "service.cos.myqcloud.com", $ = l.replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1");
          O === $ && (x = O), ce.call(this, {
            Action: "name/cos:GetService",
            url: l,
            method: "GET",
            headers: e.Headers,
            SignHost: x
          }, function(_e, Re) {
            if (_e)
              return h(_e);
            var ke = Re && Re.ListAllMyBucketsResult && Re.ListAllMyBucketsResult.Buckets && Re.ListAllMyBucketsResult.Buckets.Bucket || [];
            ke = a.isArray(ke) ? ke : [ke];
            var we = Re && Re.ListAllMyBucketsResult && Re.ListAllMyBucketsResult.Owner || {};
            h(null, {
              Buckets: ke,
              Owner: we,
              statusCode: Re.statusCode,
              headers: Re.headers
            });
          });
        }
        function P(e, h) {
          var t = this, l = "";
          if (e.BucketAZConfig) {
            var C = {
              BucketAZConfig: e.BucketAZConfig
            };
            l = a.json2xml({
              CreateBucketConfiguration: C
            });
          }
          ce.call(this, {
            Action: "name/cos:PutBucket",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            body: l
          }, function(m, x) {
            if (m)
              return h(m);
            var O = D({
              protocol: t.options.Protocol,
              domain: t.options.Domain,
              bucket: e.Bucket,
              region: e.Region,
              isLocation: !0
            });
            h(null, {
              Location: O,
              statusCode: x.statusCode,
              headers: x.headers
            });
          });
        }
        function L(e, h) {
          ce.call(this, {
            Action: "name/cos:HeadBucket",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            method: "HEAD"
          }, h);
        }
        function A(e, h) {
          var t = {};
          t.prefix = e.Prefix || "", t.delimiter = e.Delimiter, t.marker = e.Marker, t["max-keys"] = e.MaxKeys, t["encoding-type"] = e.EncodingType, ce.call(this, {
            Action: "name/cos:GetBucket",
            ResourceKey: t.prefix,
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            qs: t
          }, function(l, C) {
            if (l)
              return h(l);
            var m = C.ListBucketResult || {}, x = m.Contents || [], O = m.CommonPrefixes || [];
            x = a.isArray(x) ? x : [x], O = a.isArray(O) ? O : [O];
            var $ = a.clone(m);
            a.extend($, {
              Contents: x,
              CommonPrefixes: O,
              statusCode: C.statusCode,
              headers: C.headers
            }), h(null, $);
          });
        }
        function B(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucket",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            method: "DELETE"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function H(e, h) {
          var t = e.Headers, l = "";
          if (e.AccessControlPolicy) {
            var C = a.clone(e.AccessControlPolicy || {}), m = C.Grants || C.Grant;
            m = a.isArray(m) ? m : [m], delete C.Grant, delete C.Grants, C.AccessControlList = {
              Grant: m
            }, l = a.json2xml({
              AccessControlPolicy: C
            }), t["Content-Type"] = "application/xml", t["Content-MD5"] = a.b64(a.md5(l));
          }
          a.each(t, function(x, O) {
            O.indexOf("x-cos-grant-") === 0 && (t[O] = E(t[O]));
          }), ce.call(this, {
            Action: "name/cos:PutBucketACL",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: t,
            action: "acl",
            body: l
          }, function(x, O) {
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function G(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketACL",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "acl"
          }, function(t, l) {
            if (t)
              return h(t);
            var C = l.AccessControlPolicy || {}, m = C.Owner || {}, x = C.AccessControlList.Grant || [];
            x = a.isArray(x) ? x : [x];
            var O = f(C);
            l.headers && l.headers["x-cos-acl"] && (O.ACL = l.headers["x-cos-acl"]), O = a.extend(O, {
              Owner: m,
              Grants: x,
              statusCode: l.statusCode,
              headers: l.headers
            }), h(null, O);
          });
        }
        function X(e, h) {
          var t = e.CORSConfiguration || {}, l = t.CORSRules || e.CORSRules || [];
          l = a.clone(a.isArray(l) ? l : [l]), a.each(l, function(O) {
            a.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function($) {
              var _e = $ + "s", Re = O[_e] || O[$] || [];
              delete O[_e], O[$] = a.isArray(Re) ? Re : [Re];
            });
          });
          var C = {
            CORSRule: l
          };
          e.ResponseVary && (C.ResponseVary = e.ResponseVary);
          var m = a.json2xml({
            CORSConfiguration: C
          }), x = e.Headers;
          x["Content-Type"] = "application/xml", x["Content-MD5"] = a.b64(a.md5(m)), ce.call(this, {
            Action: "name/cos:PutBucketCORS",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: m,
            action: "cors",
            headers: x
          }, function(O, $) {
            if (O)
              return h(O);
            h(null, {
              statusCode: $.statusCode,
              headers: $.headers
            });
          });
        }
        function N(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketCORS",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "cors"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error && t.error.Code === "NoSuchCORSConfiguration") {
                var C = {
                  CORSRules: [],
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = l.CORSConfiguration || {}, x = m.CORSRules || m.CORSRule || [];
            x = a.clone(a.isArray(x) ? x : [x]);
            var O = m.ResponseVary;
            a.each(x, function($) {
              a.each(["AllowedOrigin", "AllowedHeader", "AllowedMethod", "ExposeHeader"], function(_e) {
                var Re = _e + "s", ke = $[Re] || $[_e] || [];
                delete $[_e], $[Re] = a.isArray(ke) ? ke : [ke];
              });
            }), h(null, {
              CORSRules: x,
              ResponseVary: O,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function F(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketCORS",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "cors"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode || t.statusCode,
              headers: l.headers
            });
          });
        }
        function ne(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketLocation",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "location"
          }, h);
        }
        function W(e, h) {
          var t = e.Policy;
          try {
            typeof t == "string" && (t = JSON.parse(t));
          } catch {
          }
          if (!t || typeof t == "string")
            return h(a.error(new Error("Policy format error")));
          var l = JSON.stringify(t);
          t.version || (t.version = "2.0");
          var C = e.Headers;
          C["Content-Type"] = "application/json", C["Content-MD5"] = a.b64(a.md5(l)), ce.call(this, {
            Action: "name/cos:PutBucketPolicy",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            action: "policy",
            body: l,
            headers: C
          }, function(m, x) {
            if (m && m.statusCode === 204)
              return h(null, {
                statusCode: m.statusCode
              });
            if (m)
              return h(m);
            h(null, {
              statusCode: x.statusCode,
              headers: x.headers
            });
          });
        }
        function he(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketPolicy",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "policy",
            rawBody: !0
          }, function(t, l) {
            if (t)
              return t.statusCode && t.statusCode === 403 ? h(a.error(t, {
                ErrorStatus: "Access Denied"
              })) : t.statusCode && t.statusCode === 405 ? h(a.error(t, {
                ErrorStatus: "Method Not Allowed"
              })) : t.statusCode && t.statusCode === 404 ? h(a.error(t, {
                ErrorStatus: "Policy Not Found"
              })) : h(t);
            var C = {};
            try {
              C = JSON.parse(l.body);
            } catch {
            }
            h(null, {
              Policy: C,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function _(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketPolicy",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "policy"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode || t.statusCode,
              headers: l.headers
            });
          });
        }
        function T(e, h) {
          var t = e.Tagging || {}, l = t.TagSet || t.Tags || e.Tags || [];
          l = a.clone(a.isArray(l) ? l : [l]);
          var C = a.json2xml({
            Tagging: {
              TagSet: {
                Tag: l
              }
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketTagging",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "tagging",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function y(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketTagging",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "tagging"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error && (t.error === "Not Found" || t.error.Code === "NoSuchTagSet")) {
                var C = {
                  Tags: [],
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = [];
            try {
              m = l.Tagging.TagSet.Tag || [];
            } catch {
            }
            m = a.clone(a.isArray(m) ? m : [m]), h(null, {
              Tags: m,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function Q(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketTagging",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "tagging"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function p(e, h) {
          var t = e.LifecycleConfiguration || {}, l = t.Rules || e.Rules || [];
          l = a.clone(l);
          var C = a.json2xml({
            LifecycleConfiguration: {
              Rule: l
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketLifecycle",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "lifecycle",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function M(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketLifecycle",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "lifecycle"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error && t.error.Code === "NoSuchLifecycleConfiguration") {
                var C = {
                  Rules: [],
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = [];
            try {
              m = l.LifecycleConfiguration.Rule || [];
            } catch {
            }
            m = a.clone(a.isArray(m) ? m : [m]), h(null, {
              Rules: m,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function j(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketLifecycle",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "lifecycle"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function K(e, h) {
          if (!e.VersioningConfiguration) {
            h(a.error(new Error("missing param VersioningConfiguration")));
            return;
          }
          var t = e.VersioningConfiguration || {}, l = a.json2xml({
            VersioningConfiguration: t
          }), C = e.Headers;
          C["Content-Type"] = "application/xml", C["Content-MD5"] = a.b64(a.md5(l)), ce.call(this, {
            Action: "name/cos:PutBucketVersioning",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: l,
            action: "versioning",
            headers: C
          }, function(m, x) {
            if (m && m.statusCode === 204)
              return h(null, {
                statusCode: m.statusCode
              });
            if (m)
              return h(m);
            h(null, {
              statusCode: x.statusCode,
              headers: x.headers
            });
          });
        }
        function oe(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketVersioning",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "versioning"
          }, function(t, l) {
            t || !l.VersioningConfiguration && (l.VersioningConfiguration = {}), h(t, l);
          });
        }
        function w(e, h) {
          var t = a.clone(e.ReplicationConfiguration), l = a.json2xml({
            ReplicationConfiguration: t
          });
          l = l.replace(/<(\/?)Rules>/gi, "<$1Rule>"), l = l.replace(/<(\/?)Tags>/gi, "<$1Tag>");
          var C = e.Headers;
          C["Content-Type"] = "application/xml", C["Content-MD5"] = a.b64(a.md5(l)), ce.call(this, {
            Action: "name/cos:PutBucketReplication",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: l,
            action: "replication",
            headers: C
          }, function(m, x) {
            if (m && m.statusCode === 204)
              return h(null, {
                statusCode: m.statusCode
              });
            if (m)
              return h(m);
            h(null, {
              statusCode: x.statusCode,
              headers: x.headers
            });
          });
        }
        function z(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketReplication",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "replication"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error && (t.error === "Not Found" || t.error.Code === "ReplicationConfigurationnotFoundError")) {
                var C = {
                  ReplicationConfiguration: {
                    Rules: []
                  },
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            !l.ReplicationConfiguration && (l.ReplicationConfiguration = {}), l.ReplicationConfiguration.Rule && (l.ReplicationConfiguration.Rules = a.makeArray(l.ReplicationConfiguration.Rule), delete l.ReplicationConfiguration.Rule), h(t, l);
          });
        }
        function q(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketReplication",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "replication"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function V(e, h) {
          if (!e.WebsiteConfiguration) {
            h(a.error(new Error("missing param WebsiteConfiguration")));
            return;
          }
          var t = a.clone(e.WebsiteConfiguration || {}), l = t.RoutingRules || t.RoutingRule || [];
          l = a.isArray(l) ? l : [l], delete t.RoutingRule, delete t.RoutingRules, l.length && (t.RoutingRules = {
            RoutingRule: l
          });
          var C = a.json2xml({
            WebsiteConfiguration: t
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketWebsite",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "website",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function Y(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketWebsite",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            action: "website"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error.Code === "NoSuchWebsiteConfiguration") {
                var C = {
                  WebsiteConfiguration: {},
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = l.WebsiteConfiguration || {};
            if (m.RoutingRules) {
              var x = a.clone(m.RoutingRules.RoutingRule || []);
              x = a.makeArray(x), m.RoutingRules = x;
            }
            h(null, {
              WebsiteConfiguration: m,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function ie(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketWebsite",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "website"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function le(e, h) {
          if (!e.RefererConfiguration) {
            h(a.error(new Error("missing param RefererConfiguration")));
            return;
          }
          var t = a.clone(e.RefererConfiguration || {}), l = t.DomainList || {}, C = l.Domains || l.Domain || [];
          C = a.isArray(C) ? C : [C], C.length && (t.DomainList = {
            Domain: C
          });
          var m = a.json2xml({
            RefererConfiguration: t
          }), x = e.Headers;
          x["Content-Type"] = "application/xml", x["Content-MD5"] = a.b64(a.md5(m)), ce.call(this, {
            Action: "name/cos:PutBucketReferer",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: m,
            action: "referer",
            headers: x
          }, function(O, $) {
            if (O && O.statusCode === 204)
              return h(null, {
                statusCode: O.statusCode
              });
            if (O)
              return h(O);
            h(null, {
              statusCode: $.statusCode,
              headers: $.headers
            });
          });
        }
        function ue(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketReferer",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            action: "referer"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error.Code === "NoSuchRefererConfiguration") {
                var C = {
                  WebsiteConfiguration: {},
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = l.RefererConfiguration || {};
            if (m.DomainList) {
              var x = a.makeArray(m.DomainList.Domain || []);
              m.DomainList = {
                Domains: x
              };
            }
            h(null, {
              RefererConfiguration: m,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function ee(e, h) {
          var t = e.DomainConfiguration || {}, l = t.DomainRule || e.DomainRule || [];
          l = a.clone(l);
          var C = a.json2xml({
            DomainConfiguration: {
              DomainRule: l
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketDomain",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "domain",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function de(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketDomain",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "domain"
          }, function(t, l) {
            if (t)
              return h(t);
            var C = [];
            try {
              C = l.DomainConfiguration.DomainRule || [];
            } catch {
            }
            C = a.clone(a.isArray(C) ? C : [C]), h(null, {
              DomainRule: C,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function ae(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketDomain",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "domain"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function Ce(e, h) {
          var t = e.OriginConfiguration || {}, l = t.OriginRule || e.OriginRule || [];
          l = a.clone(l);
          var C = a.json2xml({
            OriginConfiguration: {
              OriginRule: l
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketOrigin",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "origin",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function J(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketOrigin",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "origin"
          }, function(t, l) {
            if (t)
              return h(t);
            var C = [];
            try {
              C = l.OriginConfiguration.OriginRule || [];
            } catch {
            }
            C = a.clone(a.isArray(C) ? C : [C]), h(null, {
              OriginRule: C,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function re(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketOrigin",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "origin"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function pe(e, h) {
          var t = a.json2xml({
            BucketLoggingStatus: e.BucketLoggingStatus || ""
          }), l = e.Headers;
          l["Content-Type"] = "application/xml", l["Content-MD5"] = a.b64(a.md5(t)), ce.call(this, {
            Action: "name/cos:PutBucketLogging",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: t,
            action: "logging",
            headers: l
          }, function(C, m) {
            if (C && C.statusCode === 204)
              return h(null, {
                statusCode: C.statusCode
              });
            if (C)
              return h(C);
            h(null, {
              statusCode: m.statusCode,
              headers: m.headers
            });
          });
        }
        function Se(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketLogging",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "logging"
          }, function(t, l) {
            if (t)
              return h(t);
            h(null, {
              BucketLoggingStatus: l.BucketLoggingStatus,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function ve(e, h, t) {
          var l = a.clone(h.InventoryConfiguration);
          if (l.OptionalFields) {
            var C = l.OptionalFields || [];
            l.OptionalFields = {
              Field: C
            };
          }
          if (l.Destination && l.Destination.COSBucketDestination && l.Destination.COSBucketDestination.Encryption) {
            var m = l.Destination.COSBucketDestination.Encryption;
            Object.keys(m).indexOf("SSECOS") > -1 && (m["SSE-COS"] = m.SSECOS, delete m.SSECOS);
          }
          var x = a.json2xml({
            InventoryConfiguration: l
          }), O = h.Headers;
          O["Content-Type"] = "application/xml", O["Content-MD5"] = a.b64(a.md5(x));
          var $ = e === "PUT" ? "name/cos:PutBucketInventory" : "name/cos:PostBucketInventory";
          ce.call(this, {
            Action: $,
            method: e,
            Bucket: h.Bucket,
            Region: h.Region,
            body: x,
            action: "inventory",
            qs: {
              id: h.Id
            },
            headers: O
          }, function(_e, Re) {
            if (_e && _e.statusCode === 204)
              return t(null, {
                statusCode: _e.statusCode
              });
            if (_e)
              return t(_e);
            t(null, {
              statusCode: Re.statusCode,
              headers: Re.headers
            });
          });
        }
        function me(e, h) {
          return ve.call(this, "PUT", e, h);
        }
        function Te(e, h) {
          return ve.call(this, "POST", e, h);
        }
        function Ee(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketInventory",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "inventory",
            qs: {
              id: e.Id
            }
          }, function(t, l) {
            if (t)
              return h(t);
            var C = l.InventoryConfiguration;
            if (C && C.OptionalFields && C.OptionalFields.Field) {
              var m = C.OptionalFields.Field;
              a.isArray(m) || (m = [m]), C.OptionalFields = m;
            }
            if (C.Destination && C.Destination.COSBucketDestination && C.Destination.COSBucketDestination.Encryption) {
              var x = C.Destination.COSBucketDestination.Encryption;
              Object.keys(x).indexOf("SSE-COS") > -1 && (x.SSECOS = x["SSE-COS"], delete x["SSE-COS"]);
            }
            h(null, {
              InventoryConfiguration: C,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function be(e, h) {
          ce.call(this, {
            Action: "name/cos:ListBucketInventory",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "inventory",
            qs: {
              "continuation-token": e.ContinuationToken
            }
          }, function(t, l) {
            if (t)
              return h(t);
            var C = l.ListInventoryConfigurationResult, m = C.InventoryConfiguration || [];
            m = a.isArray(m) ? m : [m], delete C.InventoryConfiguration, a.each(m, function(x) {
              if (x && x.OptionalFields && x.OptionalFields.Field) {
                var O = x.OptionalFields.Field;
                a.isArray(O) || (O = [O]), x.OptionalFields = O;
              }
              if (x.Destination && x.Destination.COSBucketDestination && x.Destination.COSBucketDestination.Encryption) {
                var $ = x.Destination.COSBucketDestination.Encryption;
                Object.keys($).indexOf("SSE-COS") > -1 && ($.SSECOS = $["SSE-COS"], delete $["SSE-COS"]);
              }
            }), C.InventoryConfigurations = m, a.extend(C, {
              statusCode: l.statusCode,
              headers: l.headers
            }), h(null, C);
          });
        }
        function Ie(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketInventory",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "inventory",
            qs: {
              id: e.Id
            }
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function Ae(e, h) {
          if (!e.AccelerateConfiguration) {
            h(a.error(new Error("missing param AccelerateConfiguration")));
            return;
          }
          var t = {
            AccelerateConfiguration: e.AccelerateConfiguration || {}
          }, l = a.json2xml(t), C = {};
          C["Content-Type"] = "application/xml", C["Content-MD5"] = a.b64(a.md5(l)), ce.call(this, {
            Action: "name/cos:PutBucketAccelerate",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: l,
            action: "accelerate",
            headers: C
          }, function(m, x) {
            if (m)
              return h(m);
            h(null, {
              statusCode: x.statusCode,
              headers: x.headers
            });
          });
        }
        function Oe(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketAccelerate",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            action: "accelerate"
          }, function(t, l) {
            t || !l.AccelerateConfiguration && (l.AccelerateConfiguration = {}), h(t, l);
          });
        }
        function se(e, h) {
          var t = e.ServerSideEncryptionConfiguration || {}, l = t.Rule || t.Rules || [], C = a.json2xml({
            ServerSideEncryptionConfiguration: {
              Rule: l
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutBucketEncryption",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "encryption",
            headers: m
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function b(e, h) {
          ce.call(this, {
            Action: "name/cos:GetBucketEncryption",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "encryption"
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.code === "NoSuchEncryptionConfiguration") {
                var C = {
                  EncryptionConfiguration: {
                    Rules: []
                  },
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = a.makeArray(l.EncryptionConfiguration && l.EncryptionConfiguration.Rule || []);
            l.EncryptionConfiguration = {
              Rules: m
            }, h(t, l);
          });
        }
        function U(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteBucketReplication",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "encryption"
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function g(e, h) {
          ce.call(this, {
            Action: "name/cos:HeadObject",
            method: "HEAD",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            VersionId: e.VersionId,
            headers: e.Headers
          }, function(t, l) {
            if (t) {
              var C = t.statusCode;
              return e.Headers["If-Modified-Since"] && C && C === 304 ? h(null, {
                NotModified: !0,
                statusCode: C
              }) : h(t);
            }
            l.ETag = a.attr(l.headers, "etag", ""), h(null, l);
          });
        }
        function o(e, h) {
          var t = {};
          t.prefix = e.Prefix || "", t.delimiter = e.Delimiter, t["key-marker"] = e.KeyMarker, t["version-id-marker"] = e.VersionIdMarker, t["max-keys"] = e.MaxKeys, t["encoding-type"] = e.EncodingType, ce.call(this, {
            Action: "name/cos:GetBucketObjectVersions",
            ResourceKey: t.prefix,
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            qs: t,
            action: "versions"
          }, function(l, C) {
            if (l)
              return h(l);
            var m = C.ListVersionsResult || {}, x = m.DeleteMarker || [];
            x = a.isArray(x) ? x : [x];
            var O = m.Version || [];
            O = a.isArray(O) ? O : [O];
            var $ = a.clone(m);
            delete $.DeleteMarker, delete $.Version, a.extend($, {
              DeleteMarkers: x,
              Versions: O,
              statusCode: C.statusCode,
              headers: C.headers
            }), h(null, $);
          });
        }
        function c(e, h) {
          var t = e.Query || {}, l = e.QueryString || "", C = a.throttleOnProgress.call(this, 0, e.onProgress), m = e.tracker;
          m && m.setParams({
            signStartTime: new Date().getTime()
          }), t["response-content-type"] = e.ResponseContentType, t["response-content-language"] = e.ResponseContentLanguage, t["response-expires"] = e.ResponseExpires, t["response-cache-control"] = e.ResponseCacheControl, t["response-content-disposition"] = e.ResponseContentDisposition, t["response-content-encoding"] = e.ResponseContentEncoding, ce.call(this, {
            Action: "name/cos:GetObject",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            VersionId: e.VersionId,
            DataType: e.DataType,
            headers: e.Headers,
            qs: t,
            qsStr: l,
            rawBody: !0,
            onDownloadProgress: C,
            tracker: m
          }, function(x, O) {
            if (C(null, !0), x) {
              var $ = x.statusCode;
              return e.Headers["If-Modified-Since"] && $ && $ === 304 ? h(null, {
                NotModified: !0
              }) : h(x);
            }
            h(null, {
              Body: O.body,
              ETag: a.attr(O.headers, "etag", ""),
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function u(e, h) {
          var t = this, l = e.ContentLength, C = a.throttleOnProgress.call(t, l, e.onProgress), m = e.Headers;
          !m["Cache-Control"] && !m["cache-control"] && (m["Cache-Control"] = ""), !m["Content-Type"] && !m["content-type"] && (m["Content-Type"] = e.Body && e.Body.type || "");
          var x = e.UploadAddMetaMd5 || t.options.UploadAddMetaMd5 || t.options.UploadCheckContentMd5, O = e.tracker;
          x && O && O.setParams({
            md5StartTime: new Date().getTime()
          }), a.getBodyMd5(x, e.Body, function($) {
            $ && (O && O.setParams({
              md5EndTime: new Date().getTime()
            }), t.options.UploadCheckContentMd5 && (m["Content-MD5"] = a.b64($)), (e.UploadAddMetaMd5 || t.options.UploadAddMetaMd5) && (m["x-cos-meta-md5"] = $)), e.ContentLength !== void 0 && (m["Content-Length"] = e.ContentLength), C(null, !0), ce.call(t, {
              Action: "name/cos:PutObject",
              TaskId: e.TaskId,
              method: "PUT",
              Bucket: e.Bucket,
              Region: e.Region,
              Key: e.Key,
              headers: e.Headers,
              qs: e.Query,
              body: e.Body,
              onProgress: C,
              tracker: O
            }, function(_e, Re) {
              if (_e)
                return C(null, !0), h(_e);
              C({
                loaded: l,
                total: l
              }, !0);
              var ke = D({
                ForcePathStyle: t.options.ForcePathStyle,
                protocol: t.options.Protocol,
                domain: t.options.Domain,
                bucket: e.Bucket,
                region: t.options.UseAccelerate ? "accelerate" : e.Region,
                object: e.Key
              });
              ke = ke.substr(ke.indexOf("://") + 3), Re.Location = ke, Re.ETag = a.attr(Re.headers, "etag", ""), h(null, Re);
            });
          }, e.onHashProgress);
        }
        function v(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteObject",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            VersionId: e.VersionId,
            action: e.Recursive ? "recursive" : ""
          }, function(t, l) {
            if (t) {
              var C = t.statusCode;
              return C && C === 404 ? h(null, {
                BucketNotFound: !0,
                statusCode: C
              }) : h(t);
            }
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function R(e, h) {
          var t = {};
          e.VersionId && (t.versionId = e.VersionId), ce.call(this, {
            Action: "name/cos:GetObjectACL",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            qs: t,
            action: "acl"
          }, function(l, C) {
            if (l)
              return h(l);
            var m = C.AccessControlPolicy || {}, x = m.Owner || {}, O = m.AccessControlList && m.AccessControlList.Grant || [];
            O = a.isArray(O) ? O : [O];
            var $ = f(m);
            delete $.GrantWrite, C.headers && C.headers["x-cos-acl"] && ($.ACL = C.headers["x-cos-acl"]), $ = a.extend($, {
              Owner: x,
              Grants: O,
              statusCode: C.statusCode,
              headers: C.headers
            }), h(null, $);
          });
        }
        function I(e, h) {
          var t = e.Headers, l = "";
          if (e.AccessControlPolicy) {
            var C = a.clone(e.AccessControlPolicy || {}), m = C.Grants || C.Grant;
            m = a.isArray(m) ? m : [m], delete C.Grant, delete C.Grants, C.AccessControlList = {
              Grant: m
            }, l = a.json2xml({
              AccessControlPolicy: C
            }), t["Content-Type"] = "application/xml", t["Content-MD5"] = a.b64(a.md5(l));
          }
          a.each(t, function(x, O) {
            O.indexOf("x-cos-grant-") === 0 && (t[O] = E(t[O]));
          }), ce.call(this, {
            Action: "name/cos:PutObjectACL",
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            action: "acl",
            headers: t,
            body: l
          }, function(x, O) {
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function Z(e, h) {
          var t = e.Headers;
          t.Origin = e.Origin, t["Access-Control-Request-Method"] = e.AccessControlRequestMethod, t["Access-Control-Request-Headers"] = e.AccessControlRequestHeaders, ce.call(this, {
            Action: "name/cos:OptionsObject",
            method: "OPTIONS",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: t
          }, function(l, C) {
            if (l)
              return l.statusCode && l.statusCode === 403 ? h(null, {
                OptionsForbidden: !0,
                statusCode: l.statusCode
              }) : h(l);
            var m = C.headers || {};
            h(null, {
              AccessControlAllowOrigin: m["access-control-allow-origin"],
              AccessControlAllowMethods: m["access-control-allow-methods"],
              AccessControlAllowHeaders: m["access-control-allow-headers"],
              AccessControlExposeHeaders: m["access-control-expose-headers"],
              AccessControlMaxAge: m["access-control-max-age"],
              statusCode: C.statusCode,
              headers: C.headers
            });
          });
        }
        function ge(e, h) {
          var t = this, l = e.Headers;
          !l["Cache-Control"] && !l["cache-control"] && (l["Cache-Control"] = "");
          var C = e.CopySource || "", m = a.getSourceParams.call(this, C);
          if (!m) {
            h(a.error(new Error("CopySource format error")));
            return;
          }
          var x = m.Bucket, O = m.Region, $ = decodeURIComponent(m.Key);
          ce.call(this, {
            Scope: [{
              action: "name/cos:GetObject",
              bucket: x,
              region: O,
              prefix: $
            }, {
              action: "name/cos:PutObject",
              bucket: e.Bucket,
              region: e.Region,
              prefix: e.Key
            }],
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            VersionId: e.VersionId,
            headers: e.Headers
          }, function(_e, Re) {
            if (_e)
              return h(_e);
            var ke = a.clone(Re.CopyObjectResult || {}), we = D({
              ForcePathStyle: t.options.ForcePathStyle,
              protocol: t.options.Protocol,
              domain: t.options.Domain,
              bucket: e.Bucket,
              region: e.Region,
              object: e.Key,
              isLocation: !0
            });
            a.extend(ke, {
              Location: we,
              statusCode: Re.statusCode,
              headers: Re.headers
            }), h(null, ke);
          });
        }
        function ye(e, h) {
          var t = e.CopySource || "", l = a.getSourceParams.call(this, t);
          if (!l) {
            h(a.error(new Error("CopySource format error")));
            return;
          }
          var C = l.Bucket, m = l.Region, x = decodeURIComponent(l.Key);
          ce.call(this, {
            Scope: [{
              action: "name/cos:GetObject",
              bucket: C,
              region: m,
              prefix: x
            }, {
              action: "name/cos:PutObject",
              bucket: e.Bucket,
              region: e.Region,
              prefix: e.Key
            }],
            method: "PUT",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            VersionId: e.VersionId,
            qs: {
              partNumber: e.PartNumber,
              uploadId: e.UploadId
            },
            headers: e.Headers
          }, function(O, $) {
            if (O)
              return h(O);
            var _e = a.clone($.CopyPartResult || {});
            a.extend(_e, {
              statusCode: $.statusCode,
              headers: $.headers
            }), h(null, _e);
          });
        }
        function te(e, h) {
          var t = e.Objects || [], l = e.Quiet;
          t = a.isArray(t) ? t : [t];
          var C = a.json2xml({
            Delete: {
              Object: t,
              Quiet: l || !1
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C));
          var x = a.map(t, function(O) {
            return {
              action: "name/cos:DeleteObject",
              bucket: e.Bucket,
              region: e.Region,
              prefix: O.Key
            };
          });
          ce.call(this, {
            Scope: x,
            method: "POST",
            Bucket: e.Bucket,
            Region: e.Region,
            body: C,
            action: "delete",
            headers: m
          }, function(O, $) {
            if (O)
              return h(O);
            var _e = $.DeleteResult || {}, Re = _e.Deleted || [], ke = _e.Error || [];
            Re = a.isArray(Re) ? Re : [Re], ke = a.isArray(ke) ? ke : [ke];
            var we = a.clone(_e);
            a.extend(we, {
              Error: ke,
              Deleted: Re,
              statusCode: $.statusCode,
              headers: $.headers
            }), h(null, we);
          });
        }
        function De(e, h) {
          var t = e.Headers;
          if (!e.RestoreRequest) {
            h(a.error(new Error("missing param RestoreRequest")));
            return;
          }
          var l = e.RestoreRequest || {}, C = a.json2xml({
            RestoreRequest: l
          });
          t["Content-Type"] = "application/xml", t["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:RestoreObject",
            method: "POST",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            VersionId: e.VersionId,
            body: C,
            action: "restore",
            headers: t
          }, h);
        }
        function xe(e, h) {
          var t = e.Tagging || {}, l = t.TagSet || t.Tags || e.Tags || [];
          l = a.clone(a.isArray(l) ? l : [l]);
          var C = a.json2xml({
            Tagging: {
              TagSet: {
                Tag: l
              }
            }
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:PutObjectTagging",
            method: "PUT",
            Bucket: e.Bucket,
            Key: e.Key,
            Region: e.Region,
            body: C,
            action: "tagging",
            headers: m,
            VersionId: e.VersionId
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers
            });
          });
        }
        function Ne(e, h) {
          ce.call(this, {
            Action: "name/cos:GetObjectTagging",
            method: "GET",
            Key: e.Key,
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            action: "tagging",
            VersionId: e.VersionId
          }, function(t, l) {
            if (t) {
              if (t.statusCode === 404 && t.error && (t.error === "Not Found" || t.error.Code === "NoSuchTagSet")) {
                var C = {
                  Tags: [],
                  statusCode: t.statusCode
                };
                t.headers && (C.headers = t.headers), h(null, C);
              } else
                h(t);
              return;
            }
            var m = [];
            try {
              m = l.Tagging.TagSet.Tag || [];
            } catch {
            }
            m = a.clone(a.isArray(m) ? m : [m]), h(null, {
              Tags: m,
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function Fe(e, h) {
          ce.call(this, {
            Action: "name/cos:DeleteObjectTagging",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            action: "tagging",
            VersionId: e.VersionId
          }, function(t, l) {
            if (t && t.statusCode === 204)
              return h(null, {
                statusCode: t.statusCode
              });
            if (t)
              return h(t);
            h(null, {
              statusCode: l.statusCode,
              headers: l.headers
            });
          });
        }
        function Ke(e, h) {
          var t = e.SelectType;
          if (!t)
            return h(a.error(new Error("missing param SelectType")));
          var l = e.SelectRequest || {}, C = a.json2xml({
            SelectRequest: l
          }), m = e.Headers;
          m["Content-Type"] = "application/xml", m["Content-MD5"] = a.b64(a.md5(C)), ce.call(this, {
            Action: "name/cos:GetObject",
            method: "POST",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            action: "select",
            qs: {
              "select-type": e.SelectType
            },
            VersionId: e.VersionId,
            body: C,
            DataType: "arraybuffer",
            rawBody: !0
          }, function(x, O) {
            if (x && x.statusCode === 204)
              return h(null, {
                statusCode: x.statusCode
              });
            if (x)
              return h(x);
            var $ = a.parseSelectPayload(O.body);
            h(null, {
              statusCode: O.statusCode,
              headers: O.headers,
              Body: $.body,
              Payload: $.payload
            });
          });
        }
        function qe(e, h) {
          var t = this, l = e.Headers, C = e.tracker;
          !l["Cache-Control"] && !l["cache-control"] && (l["Cache-Control"] = ""), !l["Content-Type"] && !l["content-type"] && (l["Content-Type"] = e.Body && e.Body.type || "");
          var m = e.Body && (e.UploadAddMetaMd5 || t.options.UploadAddMetaMd5);
          m && C && C.setParams({
            md5StartTime: new Date().getTime()
          }), a.getBodyMd5(m, e.Body, function(x) {
            x && (e.Headers["x-cos-meta-md5"] = x), m && C && C.setParams({
              md5EndTime: new Date().getTime()
            }), ce.call(t, {
              Action: "name/cos:InitiateMultipartUpload",
              method: "POST",
              Bucket: e.Bucket,
              Region: e.Region,
              Key: e.Key,
              action: "uploads",
              headers: e.Headers,
              qs: e.Query,
              tracker: C
            }, function(O, $) {
              if (O)
                return C && C.parent && C.parent.setParams({
                  errorNode: "multipartInit"
                }), h(O);
              if ($ = a.clone($ || {}), $ && $.InitiateMultipartUploadResult)
                return h(null, a.extend($.InitiateMultipartUploadResult, {
                  statusCode: $.statusCode,
                  headers: $.headers
                }));
              h(null, $);
            });
          }, e.onHashProgress);
        }
        function Xe(e, h) {
          var t = this;
          a.getFileSize("multipartUpload", e, function() {
            var l = e.tracker, C = t.options.UploadCheckContentMd5;
            C && l && l.setParams({
              md5StartTime: new Date().getTime()
            }), a.getBodyMd5(C, e.Body, function(m) {
              m && (e.Headers["Content-MD5"] = a.b64(m)), C && l && l.setParams({
                md5EndTime: new Date().getTime()
              }), l && l.setParams({
                partNumber: e.PartNumber
              }), ce.call(t, {
                Action: "name/cos:UploadPart",
                TaskId: e.TaskId,
                method: "PUT",
                Bucket: e.Bucket,
                Region: e.Region,
                Key: e.Key,
                qs: {
                  partNumber: e.PartNumber,
                  uploadId: e.UploadId
                },
                headers: e.Headers,
                onProgress: e.onProgress,
                body: e.Body || null,
                tracker: l
              }, function(x, O) {
                if (x)
                  return l && l.parent && l.parent.setParams({
                    errorNode: "multipartUpload"
                  }), h(x);
                h(null, {
                  ETag: a.attr(O.headers, "etag", ""),
                  statusCode: O.statusCode,
                  headers: O.headers
                });
              });
            });
          });
        }
        function Ge(e, h) {
          for (var t = this, l = e.UploadId, C = e.Parts, m = e.tracker, x = 0, O = C.length; x < O; x++)
            C[x].ETag && C[x].ETag.indexOf('"') === 0 || (C[x].ETag = '"' + C[x].ETag + '"');
          var $ = a.json2xml({
            CompleteMultipartUpload: {
              Part: C
            }
          });
          $ = $.replace(/\n\s*/g, "");
          var _e = e.Headers;
          _e["Content-Type"] = "application/xml", _e["Content-MD5"] = a.b64(a.md5($)), ce.call(this, {
            Action: "name/cos:CompleteMultipartUpload",
            method: "POST",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            qs: {
              uploadId: l
            },
            body: $,
            headers: _e,
            tracker: m
          }, function(Re, ke) {
            if (Re)
              return m && m.parent && m.parent.setParams({
                errorNode: "multipartComplete"
              }), h(Re);
            var we = D({
              ForcePathStyle: t.options.ForcePathStyle,
              protocol: t.options.Protocol,
              domain: t.options.Domain,
              bucket: e.Bucket,
              region: e.Region,
              object: e.Key,
              isLocation: !0
            }), je = ke.CompleteMultipartUploadResult || {};
            je.ProcessResults && je && je.ProcessResults && (je.UploadResult = {
              OriginalInfo: {
                Key: je.Key,
                Location: we,
                ETag: je.ETag,
                ImageInfo: je.ImageInfo
              },
              ProcessResults: je.ProcessResults
            }, delete je.ImageInfo, delete je.ProcessResults);
            var Ye = a.extend(je, {
              Location: we,
              statusCode: ke.statusCode,
              headers: ke.headers
            });
            h(null, Ye);
          });
        }
        function ze(e, h) {
          var t = {};
          t.delimiter = e.Delimiter, t["encoding-type"] = e.EncodingType, t.prefix = e.Prefix || "", t["max-uploads"] = e.MaxUploads, t["key-marker"] = e.KeyMarker, t["upload-id-marker"] = e.UploadIdMarker, t = a.clearKey(t);
          var l = e.tracker;
          l && l.setParams({
            signStartTime: new Date().getTime()
          }), ce.call(this, {
            Action: "name/cos:ListMultipartUploads",
            ResourceKey: t.prefix,
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            headers: e.Headers,
            qs: t,
            action: "uploads",
            tracker: l
          }, function(C, m) {
            if (C)
              return l && l.parent && l.parent.setParams({
                errorNode: "multipartList"
              }), h(C);
            if (m && m.ListMultipartUploadsResult) {
              var x = m.ListMultipartUploadsResult.Upload || [];
              x = a.isArray(x) ? x : [x], m.ListMultipartUploadsResult.Upload = x;
            }
            var O = a.clone(m.ListMultipartUploadsResult || {});
            a.extend(O, {
              statusCode: m.statusCode,
              headers: m.headers
            }), h(null, O);
          });
        }
        function Ve(e, h) {
          var t = {}, l = e.tracker;
          t.uploadId = e.UploadId, t["encoding-type"] = e.EncodingType, t["max-parts"] = e.MaxParts, t["part-number-marker"] = e.PartNumberMarker, ce.call(this, {
            Action: "name/cos:ListParts",
            method: "GET",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            qs: t
          }, function(C, m) {
            if (C)
              return l && l.parent && l.parent.setParams({
                errorNode: "multipartListPart"
              }), h(C);
            var x = m.ListPartsResult || {}, O = x.Part || [];
            O = a.isArray(O) ? O : [O], x.Part = O;
            var $ = a.clone(x);
            a.extend($, {
              statusCode: m.statusCode,
              headers: m.headers
            }), h(null, $);
          });
        }
        function We(e, h) {
          var t = {};
          t.uploadId = e.UploadId, ce.call(this, {
            Action: "name/cos:AbortMultipartUpload",
            method: "DELETE",
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            headers: e.Headers,
            qs: t
          }, function(l, C) {
            if (l)
              return h(l);
            h(null, {
              statusCode: C.statusCode,
              headers: C.headers
            });
          });
        }
        function st(e, h) {
          ce.call(this, {
            method: e.Method,
            Bucket: e.Bucket,
            Region: e.Region,
            Key: e.Key,
            action: e.Action,
            headers: e.Headers,
            qs: e.Query,
            body: e.Body,
            Url: e.Url,
            rawBody: e.RawBody,
            DataType: e.DataType
          }, function(t, l) {
            if (t)
              return h(t);
            l && l.body && (l.Body = l.body, delete l.body), h(t, l);
          });
        }
        function rt(e, h) {
          var t = e.Headers;
          !t["Cache-Control"] && !t["cache-control"] && (t["Cache-Control"] = ""), !t["Content-Type"] && !t["content-type"] && (t["Content-Type"] = e.Body && e.Body.type || ""), ce.call(this, {
            Action: "name/cos:AppendObject",
            method: "POST",
            Bucket: e.Bucket,
            Region: e.Region,
            action: "append",
            Key: e.Key,
            body: e.Body,
            qs: {
              position: e.Position
            },
            headers: e.Headers
          }, function(l, C) {
            if (l)
              return h(l);
            h(null, C);
          });
        }
        function tt(e) {
          var h = this;
          return a.getAuth({
            SecretId: e.SecretId || this.options.SecretId || "",
            SecretKey: e.SecretKey || this.options.SecretKey || "",
            Bucket: e.Bucket,
            Region: e.Region,
            Method: e.Method,
            Key: e.Key,
            Query: e.Query,
            Headers: e.Headers,
            Expires: e.Expires,
            UseRawKey: h.options.UseRawKey,
            SystemClockOffset: h.options.SystemClockOffset
          });
        }
        function s(e, h) {
          var t = this, l = e.UseAccelerate === void 0 ? t.options.UseAccelerate : e.UseAccelerate, C = D({
            ForcePathStyle: t.options.ForcePathStyle,
            protocol: e.Protocol || t.options.Protocol,
            domain: e.Domain || t.options.Domain,
            bucket: e.Bucket,
            region: l ? "accelerate" : e.Region,
            object: e.Key
          }), m = "";
          e.Query && (m += a.obj2str(e.Query)), e.QueryString && (m += (m ? "&" : "") + e.QueryString);
          var x = C;
          if (e.Sign !== void 0 && !e.Sign)
            return m && (x += "?" + m), h(null, {
              Url: x
            }), x;
          var O = fe.call(this, {
            Bucket: e.Bucket,
            Region: e.Region,
            UseAccelerate: e.UseAccelerate,
            Url: C
          }), $ = Be.call(this, {
            Action: (e.Method || "").toUpperCase() === "PUT" ? "name/cos:PutObject" : "name/cos:GetObject",
            Bucket: e.Bucket || "",
            Region: e.Region || "",
            Method: e.Method || "get",
            Key: e.Key,
            Expires: e.Expires,
            Headers: e.Headers,
            Query: e.Query,
            SignHost: O,
            ForceSignHost: e.ForceSignHost === !1 ? !1 : t.options.ForceSignHost
          }, function(_e, Re) {
            if (!!h) {
              if (_e) {
                h(_e);
                return;
              }
              var ke = function(Ye) {
                var ot = Ye.match(/q-url-param-list.*?(?=&)/g)[0], nt = "q-url-param-list=" + encodeURIComponent(ot.replace(/q-url-param-list=/, "")).toLowerCase(), Ze = new RegExp(ot, "g"), it = Ye.replace(Ze, nt);
                return it;
              }, we = C;
              we += "?" + (Re.Authorization.indexOf("q-signature") > -1 ? ke(Re.Authorization) : "sign=" + encodeURIComponent(Re.Authorization)), Re.SecurityToken && (we += "&x-cos-security-token=" + Re.SecurityToken), Re.ClientIP && (we += "&clientIP=" + Re.ClientIP), Re.ClientUA && (we += "&clientUA=" + Re.ClientUA), Re.Token && (we += "&token=" + Re.Token), m && (we += "&" + m), setTimeout(function() {
                h(null, {
                  Url: we
                });
              });
            }
          });
          return $ ? (x += "?" + $.Authorization + ($.SecurityToken ? "&x-cos-security-token=" + $.SecurityToken : ""), m && (x += "&" + m)) : m && (x += "?" + m), x;
        }
        function f(e) {
          var h = {
            GrantFullControl: [],
            GrantWrite: [],
            GrantRead: [],
            GrantReadAcp: [],
            GrantWriteAcp: [],
            ACL: ""
          }, t = {
            FULL_CONTROL: "GrantFullControl",
            WRITE: "GrantWrite",
            READ: "GrantRead",
            READ_ACP: "GrantReadAcp",
            WRITE_ACP: "GrantWriteAcp"
          }, l = e && e.AccessControlList || {}, C = l.Grant;
          C && (C = a.isArray(C) ? C : [C]);
          var m = {
            READ: 0,
            WRITE: 0,
            FULL_CONTROL: 0
          };
          return C && C.length && a.each(C, function(x) {
            x.Grantee.ID === "qcs::cam::anyone:anyone" || x.Grantee.URI === "http://cam.qcloud.com/groups/global/AllUsers" ? m[x.Permission] = 1 : x.Grantee.ID !== e.Owner.ID && h[t[x.Permission]].push('id="' + x.Grantee.ID + '"');
          }), m.FULL_CONTROL || m.WRITE && m.READ ? h.ACL = "public-read-write" : m.READ ? h.ACL = "public-read" : h.ACL = "private", a.each(t, function(x) {
            h[x] = E(h[x].join(","));
          }), h;
        }
        function E(e) {
          var h = e.split(","), t = {}, l, C;
          for (l = 0; l < h.length; )
            C = h[l].trim(), t[C] ? h.splice(l, 1) : (t[C] = !0, h[l] = C, l++);
          return h.join(",");
        }
        function D(e) {
          var h = e.region || "", t = e.bucket || "", l = t.substr(0, t.lastIndexOf("-")), C = t.substr(t.lastIndexOf("-") + 1), m = e.domain, x = e.object;
          typeof m == "function" && (m = m({
            Bucket: t,
            Region: h
          })), ["http", "https"].includes(e.protocol) && (e.protocol = e.protocol + ":");
          var O = e.protocol || (a.isBrowser && (typeof location > "u" ? "undefined" : d(location)) === "object" && location.protocol === "http:" ? "http:" : "https:");
          m || (["cn-south", "cn-south-2", "cn-north", "cn-east", "cn-southwest", "sg"].indexOf(h) > -1 ? m = "{Region}.myqcloud.com" : m = "cos.{Region}.myqcloud.com", e.ForcePathStyle || (m = "{Bucket}." + m)), m = m.replace(/\{\{AppId\}\}/gi, C).replace(/\{\{Bucket\}\}/gi, l).replace(/\{\{Region\}\}/gi, h).replace(/\{\{.*?\}\}/gi, ""), m = m.replace(/\{AppId\}/gi, C).replace(/\{BucketName\}/gi, l).replace(/\{Bucket\}/gi, t).replace(/\{Region\}/gi, h).replace(/\{.*?\}/gi, ""), /^[a-zA-Z]+:\/\//.test(m) || (m = O + "//" + m), m.slice(-1) === "/" && (m = m.slice(0, -1));
          var $ = m;
          return e.ForcePathStyle && ($ += "/" + t), $ += "/", x && ($ += a.camSafeUrlEncode(x).replace(/%2F/g, "/")), e.isLocation && ($ = $.replace(/^https?:\/\//, "")), $;
        }
        var fe = function(h) {
          if (!h.Bucket || !h.Region)
            return "";
          var t = h.UseAccelerate === void 0 ? this.options.UseAccelerate : h.UseAccelerate, l = h.Url || D({
            ForcePathStyle: this.options.ForcePathStyle,
            protocol: this.options.Protocol,
            domain: this.options.Domain,
            bucket: h.Bucket,
            region: t ? "accelerate" : h.Region
          }), C = l.replace(/^https?:\/\/([^/]+)(\/.*)?$/, "$1"), m = new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");
          return m.test(C) ? C : "";
        };
        function Be(e, h) {
          var t = a.clone(e.Headers), l = "";
          a.each(t, function(Ue, Pe) {
            (Ue === "" || ["content-type", "cache-control", "expires"].indexOf(Pe.toLowerCase()) > -1) && delete t[Pe], Pe.toLowerCase() === "host" && (l = Ue);
          });
          var C = e.ForceSignHost !== !1;
          !l && e.SignHost && C && (t.Host = e.SignHost);
          var m = !1, x = function(Pe, Le) {
            m || (m = !0, Le && Le.XCosSecurityToken && !Le.SecurityToken && (Le = a.clone(Le), Le.SecurityToken = Le.XCosSecurityToken, delete Le.XCosSecurityToken), h && h(Pe, Le));
          }, O = this, $ = e.Bucket || "", _e = e.Region || "", Re = e.Key || "";
          O.options.ForcePathStyle && $ && (Re = $ + "/" + Re);
          var ke = "/" + Re, we = {}, je = e.Scope;
          if (!je) {
            var Ye = e.Action || "", ot = e.ResourceKey || e.Key || "";
            je = e.Scope || [{
              action: Ye,
              bucket: $,
              region: _e,
              prefix: ot
            }];
          }
          var nt = a.md5(JSON.stringify(je));
          O._StsCache = O._StsCache || [], function() {
            var Ue, Pe;
            for (Ue = O._StsCache.length - 1; Ue >= 0; Ue--) {
              Pe = O._StsCache[Ue];
              var Le = Math.round(a.getSkewTime(O.options.SystemClockOffset) / 1e3) + 30;
              if (Pe.StartTime && Le < Pe.StartTime || Le >= Pe.ExpiredTime) {
                O._StsCache.splice(Ue, 1);
                continue;
              }
              if (!Pe.ScopeLimit || Pe.ScopeLimit && Pe.ScopeKey === nt) {
                we = Pe;
                break;
              }
            }
          }();
          var Ze = function() {
            var Pe = "";
            we.StartTime && e.Expires ? Pe = we.StartTime + ";" + (we.StartTime + e.Expires * 1) : we.StartTime && we.ExpiredTime && (Pe = we.StartTime + ";" + we.ExpiredTime);
            var Le = a.getAuth({
              SecretId: we.TmpSecretId,
              SecretKey: we.TmpSecretKey,
              Method: e.Method,
              Pathname: ke,
              Query: e.Query,
              Headers: t,
              Expires: e.Expires,
              UseRawKey: O.options.UseRawKey,
              SystemClockOffset: O.options.SystemClockOffset,
              KeyTime: Pe,
              ForceSignHost: C
            }), He = {
              Authorization: Le,
              SecurityToken: we.SecurityToken || we.XCosSecurityToken || "",
              Token: we.Token || "",
              ClientIP: we.ClientIP || "",
              ClientUA: we.ClientUA || ""
            };
            x(null, He);
          }, it = function(Pe) {
            if (Pe.Authorization) {
              var Le = !1, He = Pe.Authorization;
              if (He)
                if (He.indexOf(" ") > -1)
                  Le = !1;
                else if (He.indexOf("q-sign-algorithm=") > -1 && He.indexOf("q-ak=") > -1 && He.indexOf("q-sign-time=") > -1 && He.indexOf("q-key-time=") > -1 && He.indexOf("q-url-param-list=") > -1)
                  Le = !0;
                else
                  try {
                    He = atob(He), He.indexOf("a=") > -1 && He.indexOf("k=") > -1 && He.indexOf("t=") > -1 && He.indexOf("r=") > -1 && He.indexOf("b=") > -1 && (Le = !0);
                  } catch {
                  }
              if (!Le)
                return a.error(new Error("getAuthorization callback params format error"));
            } else {
              if (!Pe.TmpSecretId)
                return a.error(new Error('getAuthorization callback params missing "TmpSecretId"'));
              if (!Pe.TmpSecretKey)
                return a.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));
              if (!Pe.SecurityToken && !Pe.XCosSecurityToken)
                return a.error(new Error('getAuthorization callback params missing "SecurityToken"'));
              if (!Pe.ExpiredTime)
                return a.error(new Error('getAuthorization callback params missing "ExpiredTime"'));
              if (Pe.ExpiredTime && Pe.ExpiredTime.toString().length !== 10)
                return a.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));
              if (Pe.StartTime && Pe.StartTime.toString().length !== 10)
                return a.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'));
            }
            return !1;
          };
          if (we.ExpiredTime && we.ExpiredTime - a.getSkewTime(O.options.SystemClockOffset) / 1e3 > 60)
            Ze();
          else if (O.options.getAuthorization)
            O.options.getAuthorization.call(O, {
              Bucket: $,
              Region: _e,
              Method: e.Method,
              Key: Re,
              Pathname: ke,
              Query: e.Query,
              Headers: t,
              Scope: je,
              SystemClockOffset: O.options.SystemClockOffset,
              ForceSignHost: C
            }, function(Ue) {
              typeof Ue == "string" && (Ue = {
                Authorization: Ue
              });
              var Pe = it(Ue);
              if (Pe)
                return x(Pe);
              Ue.Authorization ? x(null, Ue) : (we = Ue || {}, we.Scope = je, we.ScopeKey = nt, O._StsCache.push(we), Ze());
            });
          else if (O.options.getSTS)
            O.options.getSTS.call(O, {
              Bucket: $,
              Region: _e
            }, function(Ue) {
              we = Ue || {}, we.Scope = je, we.ScopeKey = nt, we.TmpSecretId || (we.TmpSecretId = we.SecretId), we.TmpSecretKey || (we.TmpSecretKey = we.SecretKey);
              var Pe = it(we);
              if (Pe)
                return x(Pe);
              O._StsCache.push(we), Ze();
            });
          else
            return function() {
              var Ue = a.getAuth({
                SecretId: e.SecretId || O.options.SecretId,
                SecretKey: e.SecretKey || O.options.SecretKey,
                Method: e.Method,
                Pathname: ke,
                Query: e.Query,
                Headers: t,
                Expires: e.Expires,
                UseRawKey: O.options.UseRawKey,
                SystemClockOffset: O.options.SystemClockOffset,
                ForceSignHost: C
              }), Pe = {
                Authorization: Ue,
                SecurityToken: O.options.SecurityToken || O.options.XCosSecurityToken
              };
              return x(null, Pe), Pe;
            }();
          return "";
        }
        function Me(e) {
          var h = !1, t = !1, l = e.headers && (e.headers.date || e.headers.Date) || e.error && e.error.ServerTime;
          try {
            var C = e.error.Code, m = e.error.Message;
            (C === "RequestTimeTooSkewed" || C === "AccessDenied" && m === "Request has expired") && (t = !0);
          } catch {
          }
          if (e)
            if (t && l) {
              var x = Date.parse(l);
              this.options.CorrectClockSkew && Math.abs(a.getSkewTime(this.options.SystemClockOffset) - x) >= 3e4 && (console.error("error: Local time is too skewed."), this.options.SystemClockOffset = x - Date.now(), h = !0);
            } else
              Math.floor(e.statusCode / 100) === 5 && (h = !0);
          return h;
        }
        function ce(e, h) {
          var t = this;
          !e.headers && (e.headers = {}), !e.qs && (e.qs = {}), e.VersionId && (e.qs.versionId = e.VersionId), e.qs = a.clearKey(e.qs), e.headers && (e.headers = a.clearKey(e.headers)), e.qs && (e.qs = a.clearKey(e.qs));
          var l = a.clone(e.qs);
          e.action && (l[e.action] = "");
          var C = e.url || e.Url, m = e.SignHost || fe.call(this, {
            Bucket: e.Bucket,
            Region: e.Region,
            Url: C
          }), x = e.tracker, O = function $(_e) {
            var Re = t.options.SystemClockOffset;
            x && x.setParams({
              signStartTime: new Date().getTime(),
              retryTimes: _e - 1
            }), Be.call(t, {
              Bucket: e.Bucket || "",
              Region: e.Region || "",
              Method: e.method,
              Key: e.Key,
              Query: l,
              Headers: e.headers,
              SignHost: m,
              Action: e.Action,
              ResourceKey: e.ResourceKey,
              Scope: e.Scope,
              ForceSignHost: t.options.ForceSignHost
            }, function(ke, we) {
              if (ke) {
                h(ke);
                return;
              }
              x && x.setParams({
                signEndTime: new Date().getTime(),
                httpStartTime: new Date().getTime()
              }), e.AuthData = we, Qe.call(t, e, function(je, Ye) {
                x && x.setParams({
                  httpEndTime: new Date().getTime()
                }), je && _e < 2 && (Re !== t.options.SystemClockOffset || Me.call(t, je)) ? (e.headers && (delete e.headers.Authorization, delete e.headers.token, delete e.headers.clientIP, delete e.headers.clientUA, e.headers["x-cos-security-token"] && delete e.headers["x-cos-security-token"], e.headers["x-ci-security-token"] && delete e.headers["x-ci-security-token"]), $(_e + 1)) : h(je, Ye);
              });
            });
          };
          O(1);
        }
        function Qe(e, h) {
          var t = this, l = e.TaskId;
          if (!(l && !t._isRunningTask(l))) {
            var C = e.Bucket, m = e.Region, x = e.Key, O = e.method || "GET", $ = e.Url || e.url, _e = e.body, Re = e.rawBody;
            t.options.UseAccelerate && (m = "accelerate"), $ = $ || D({
              ForcePathStyle: t.options.ForcePathStyle,
              protocol: t.options.Protocol,
              domain: t.options.Domain,
              bucket: C,
              region: m,
              object: x
            }), e.action && ($ = $ + "?" + (a.isIOS_QQ ? "".concat(e.action, "=") : e.action)), e.qsStr && ($.indexOf("?") > -1 ? $ = $ + "&" + e.qsStr : $ = $ + "?" + e.qsStr);
            var ke = {
              method: O,
              url: $,
              headers: e.headers,
              qs: e.qs,
              body: _e
            }, we = "x-cos-security-token";
            if (a.isCIHost($) && (we = "x-ci-security-token"), ke.headers.Authorization = e.AuthData.Authorization, e.AuthData.Token && (ke.headers.token = e.AuthData.Token), e.AuthData.ClientIP && (ke.headers.clientIP = e.AuthData.ClientIP), e.AuthData.ClientUA && (ke.headers.clientUA = e.AuthData.ClientUA), e.AuthData.SecurityToken && (ke.headers[we] = e.AuthData.SecurityToken), ke.headers && (ke.headers = a.clearKey(ke.headers)), ke = a.clearKey(ke), e.onProgress && typeof e.onProgress == "function") {
              var je = _e && (_e.size || _e.length) || 0;
              ke.onProgress = function(Ue) {
                if (!(l && !t._isRunningTask(l))) {
                  var Pe = Ue ? Ue.loaded : 0;
                  e.onProgress({
                    loaded: Pe,
                    total: je
                  });
                }
              };
            }
            e.onDownloadProgress && (ke.onDownloadProgress = e.onDownloadProgress), e.DataType && (ke.dataType = e.DataType), this.options.Timeout && (ke.timeout = this.options.Timeout), t.options.ForcePathStyle && (ke.pathStyle = t.options.ForcePathStyle), t.emit("before-send", ke);
            var Ye = ke.url.includes("accelerate."), ot = ke.qs ? Object.keys(ke.qs).map(function(Ue) {
              return "".concat(Ue, "=").concat(ke.qs[Ue]);
            }).join("&") : "", nt = ot ? ke.url + "?" + ot : ke.url;
            e.tracker && e.tracker.setParams({
              reqUrl: nt,
              accelerate: Ye ? "Y" : "N"
            }), e.tracker && e.tracker.parent && e.tracker.parent.setParams({
              reqUrl: nt,
              accelerate: Ye ? "Y" : "N"
            });
            var Ze = (t.options.Request || S)(ke, function(Ue) {
              if (!(Ue && Ue.error === "abort")) {
                var Pe = {
                  options: ke,
                  error: Ue && Ue.error,
                  statusCode: Ue && Ue.statusCode || 0,
                  statusMessage: Ue && Ue.statusMessage || "",
                  headers: Ue && Ue.headers || {},
                  body: Ue && Ue.body
                };
                t.emit("after-receive", Pe);
                var Le = Pe.error, He = Pe.body, et = {
                  statusCode: Pe.statusCode,
                  statusMessage: Pe.statusMessage,
                  headers: Pe.headers
                }, pt, ut = function(dt, gt) {
                  if (l && t.off("inner-kill-task", it), !pt) {
                    pt = !0;
                    var ft = {};
                    et && et.statusCode && (ft.statusCode = et.statusCode), et && et.headers && (ft.headers = et.headers), dt ? (dt = a.extend(dt || {}, ft), h(dt, null)) : (gt = a.extend(gt || {}, ft), h(null, gt)), Ze = null;
                  }
                };
                if (Le)
                  return ut(a.error(Le));
                var ct = et.statusCode, vt = Math.floor(ct / 100) === 2;
                if (Re && vt)
                  return ut(null, {
                    body: He
                  });
                var at;
                try {
                  at = He && He.indexOf("<") > -1 && He.indexOf(">") > -1 && a.xml2json(He) || {};
                } catch {
                  at = {};
                }
                var lt = at && at.Error;
                vt ? ut(null, at) : lt ? ut(a.error(new Error(lt.Message), {
                  code: lt.Code,
                  error: lt
                })) : ct ? ut(a.error(new Error(et.statusMessage), {
                  code: "" + ct
                })) : ct && ut(a.error(new Error("statusCode error")));
              }
            }), it = function Ue(Pe) {
              Pe.TaskId === l && (Ze && Ze.abort && Ze.abort(), t.off("inner-kill-task", Ue));
            };
            l && t.on("inner-kill-task", it);
          }
        }
        var Je = {
          getService: k,
          putBucket: P,
          headBucket: L,
          getBucket: A,
          deleteBucket: B,
          putBucketAcl: H,
          getBucketAcl: G,
          putBucketCors: X,
          getBucketCors: N,
          deleteBucketCors: F,
          getBucketLocation: ne,
          getBucketPolicy: he,
          putBucketPolicy: W,
          deleteBucketPolicy: _,
          putBucketTagging: T,
          getBucketTagging: y,
          deleteBucketTagging: Q,
          putBucketLifecycle: p,
          getBucketLifecycle: M,
          deleteBucketLifecycle: j,
          putBucketVersioning: K,
          getBucketVersioning: oe,
          putBucketReplication: w,
          getBucketReplication: z,
          deleteBucketReplication: q,
          putBucketWebsite: V,
          getBucketWebsite: Y,
          deleteBucketWebsite: ie,
          putBucketReferer: le,
          getBucketReferer: ue,
          putBucketDomain: ee,
          getBucketDomain: de,
          deleteBucketDomain: ae,
          putBucketOrigin: Ce,
          getBucketOrigin: J,
          deleteBucketOrigin: re,
          putBucketLogging: pe,
          getBucketLogging: Se,
          putBucketInventory: me,
          postBucketInventory: Te,
          getBucketInventory: Ee,
          listBucketInventory: be,
          deleteBucketInventory: Ie,
          putBucketAccelerate: Ae,
          getBucketAccelerate: Oe,
          putBucketEncryption: se,
          getBucketEncryption: b,
          deleteBucketEncryption: U,
          getObject: c,
          headObject: g,
          listObjectVersions: o,
          putObject: u,
          deleteObject: v,
          getObjectAcl: R,
          putObjectAcl: I,
          optionsObject: Z,
          putObjectCopy: ge,
          deleteMultipleObject: te,
          restoreObject: De,
          putObjectTagging: xe,
          getObjectTagging: Ne,
          deleteObjectTagging: Fe,
          selectObjectContent: Ke,
          appendObject: rt,
          uploadPartCopy: ye,
          multipartInit: qe,
          multipartUpload: Xe,
          multipartComplete: Ge,
          multipartList: ze,
          multipartListPart: Ve,
          multipartAbort: We,
          request: st,
          getObjectUrl: s,
          getAuth: tt
        };
        function $e(e, h, t) {
          a.each(["Cors", "Acl"], function(l) {
            if (e.slice(-l.length) === l) {
              var C = e.slice(0, -l.length) + l.toUpperCase(), m = a.apiWrapper(e, h), x = !1;
              t[C] = function() {
                !x && console.warn("warning: cos." + C + " has been deprecated. Please Use cos." + e + " instead."), x = !0, m.apply(this, arguments);
              };
            }
          });
        }
        r.exports.init = function(e, h) {
          h.transferToTaskMethod(Je, "putObject"), a.each(Je, function(t, l) {
            e.prototype[l] = a.apiWrapper(l, t), $e(l, t, e.prototype);
          });
        };
      },
      "./src/cos.js": function(r, i, n) {
        var d = n("./src/util.js"), S = n("./src/event.js"), a = n("./src/task.js"), k = n("./src/base.js"), P = n("./src/advance.js"), L = n("./package.json"), A = {
          AppId: "",
          SecretId: "",
          SecretKey: "",
          SecurityToken: "",
          ChunkRetryTimes: 2,
          FileParallelLimit: 3,
          ChunkParallelLimit: 3,
          ChunkSize: 1024 * 1024,
          SliceSize: 1024 * 1024,
          CopyChunkParallelLimit: 20,
          CopyChunkSize: 1024 * 1024 * 10,
          CopySliceSize: 1024 * 1024 * 10,
          MaxPartNumber: 1e4,
          ProgressInterval: 1e3,
          Domain: "",
          ServiceDomain: "",
          Protocol: "",
          CompatibilityMode: !1,
          ForcePathStyle: !1,
          UseRawKey: !1,
          Timeout: 0,
          CorrectClockSkew: !0,
          SystemClockOffset: 0,
          UploadCheckContentMd5: !1,
          UploadQueueSize: 1e4,
          UploadAddMetaMd5: !1,
          UploadIdCacheLimit: 50,
          UseAccelerate: !1,
          ForceSignHost: !0,
          EnableTracker: !1,
          DeepTracker: !1,
          TrackerDelay: 5e3,
          CustomId: ""
        }, B = function(G) {
          this.options = d.extend(d.clone(A), G || {}), this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit), this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit), this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes), this.options.ChunkSize = Math.max(1024 * 1024, this.options.ChunkSize), this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit), this.options.CopyChunkSize = Math.max(1024 * 1024, this.options.CopyChunkSize), this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize), this.options.MaxPartNumber = Math.max(1024, Math.min(1e4, this.options.MaxPartNumber)), this.options.Timeout = Math.max(0, this.options.Timeout), this.options.AppId && console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'), this.options.SecretId && this.options.SecretId.indexOf(" ") > -1 && (console.error("error: SecretId\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"), console.error("error: SecretId format is incorrect. Please check")), this.options.SecretKey && this.options.SecretKey.indexOf(" ") > -1 && (console.error("error: SecretKey\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"), console.error("error: SecretKey format is incorrect. Please check")), d.isNode() && (console.warn("warning: cos-js-sdk-v5 \u4E0D\u652F\u6301 nodejs \u73AF\u5883\u4F7F\u7528\uFF0C\u8BF7\u6539\u7528 cos-nodejs-sdk-v5\uFF0C\u53C2\u8003\u6587\u6863\uFF1A https://cloud.tencent.com/document/product/436/8629"), console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")), S.init(this), a.init(this);
        };
        k.init(B, a), P.init(B, a), B.util = {
          md5: d.md5,
          xml2json: d.xml2json,
          json2xml: d.json2xml
        }, B.getAuthorization = d.getAuth, B.version = L.version, r.exports = B;
      },
      "./src/event.js": function(r, i) {
        var n = function(a) {
          var k = {}, P = function(A) {
            return !k[A] && (k[A] = []), k[A];
          };
          a.on = function(L, A) {
            L === "task-list-update" && console.warn('warning: Event "' + L + '" has been deprecated. Please use "list-update" instead.'), P(L).push(A);
          }, a.off = function(L, A) {
            for (var B = P(L), H = B.length - 1; H >= 0; H--)
              A === B[H] && B.splice(H, 1);
          }, a.emit = function(L, A) {
            for (var B = P(L).map(function(G) {
              return G;
            }), H = 0; H < B.length; H++)
              B[H](A);
          };
        }, d = function() {
          n(this);
        };
        r.exports.init = n, r.exports.EventProxy = d;
      },
      "./src/session.js": function(r, i, n) {
        var d = n("./src/util.js"), S = "cos_sdk_upload_cache", a = 30 * 24 * 3600, k, P, L = function() {
          try {
            var N = JSON.parse(localStorage.getItem(S));
          } catch {
          }
          N || (N = []), k = N;
        }, A = function() {
          try {
            k.length ? localStorage.setItem(S, JSON.stringify(k)) : localStorage.removeItem(S);
          } catch {
          }
        }, B = function() {
          if (!k) {
            L.call(this);
            for (var N = !1, F = Math.round(Date.now() / 1e3), ne = k.length - 1; ne >= 0; ne--) {
              var W = k[ne][2];
              (!W || W + a < F) && (k.splice(ne, 1), N = !0);
            }
            N && A();
          }
        }, H = function() {
          P || (P = setTimeout(function() {
            A(), P = null;
          }, 400));
        }, G = {
          using: {},
          setUsing: function(N) {
            G.using[N] = !0;
          },
          removeUsing: function(N) {
            delete G.using[N];
          },
          getFileId: function(N, F, ne, W) {
            return N.name && N.size && N.lastModifiedDate && F ? d.md5([N.name, N.size, N.lastModifiedDate, F, ne, W].join("::")) : null;
          },
          getCopyFileId: function(N, F, ne, W, he) {
            var _ = F["content-length"], T = F.etag || "", y = F["last-modified"];
            return N && ne ? d.md5([N, _, T, y, ne, W, he].join("::")) : null;
          },
          getUploadIdList: function(N) {
            if (!N)
              return null;
            B.call(this);
            for (var F = [], ne = 0; ne < k.length; ne++)
              k[ne][0] === N && F.push(k[ne][1]);
            return F.length ? F : null;
          },
          saveUploadId: function(N, F, ne) {
            if (B.call(this), !!N) {
              for (var W = k.length - 1; W >= 0; W--) {
                var he = k[W];
                he[0] === N && he[1] === F && k.splice(W, 1);
              }
              k.unshift([N, F, Math.round(Date.now() / 1e3)]), k.length > ne && k.splice(ne), H();
            }
          },
          removeUploadId: function(N) {
            B.call(this), delete G.using[N];
            for (var F = k.length - 1; F >= 0; F--)
              k[F][1] === N && k.splice(F, 1);
            H();
          }
        };
        r.exports = G;
      },
      "./src/task.js": function(r, i, n) {
        var d = n("./src/session.js"), S = n("./src/util.js"), a = {}, k = function(A, B) {
          a[B] = A[B], A[B] = function(H, G) {
            H.SkipTask ? a[B].call(this, H, G) : this._addTask(B, H, G);
          };
        }, P = function(A) {
          var B = [], H = {}, G = 0, X = 0, N = function(y) {
            var Q = {
              id: y.id,
              Bucket: y.Bucket,
              Region: y.Region,
              Key: y.Key,
              FilePath: y.FilePath,
              state: y.state,
              loaded: y.loaded,
              size: y.size,
              speed: y.speed,
              percent: y.percent,
              hashPercent: y.hashPercent,
              error: y.error
            };
            return y.FilePath && (Q.FilePath = y.FilePath), y._custom && (Q._custom = y._custom), Q;
          }, F = function() {
            var T, y = function() {
              T = 0, A.emit("task-list-update", {
                list: S.map(B, N)
              }), A.emit("list-update", {
                list: S.map(B, N)
              });
            };
            return function() {
              T || (T = setTimeout(y));
            };
          }(), ne = function() {
            if (!(B.length <= A.options.UploadQueueSize)) {
              for (var y = 0; y < X && y < B.length && B.length > A.options.UploadQueueSize; ) {
                var Q = B[y].state === "waiting" || B[y].state === "checking" || B[y].state === "uploading";
                !B[y] || !Q ? (H[B[y].id] && delete H[B[y].id], B.splice(y, 1), X--) : y++;
              }
              F();
            }
          }, W = function T() {
            if (!(G >= A.options.FileParallelLimit)) {
              for (; B[X] && B[X].state !== "waiting"; )
                X++;
              if (!(X >= B.length)) {
                var y = B[X];
                X++, G++, y.state = "checking", y.params.onTaskStart && y.params.onTaskStart(N(y)), !y.params.UploadData && (y.params.UploadData = {});
                var Q = S.formatParams(y.api, y.params);
                a[y.api].call(A, Q, function(p, M) {
                  !A._isRunningTask(y.id) || ((y.state === "checking" || y.state === "uploading") && (y.state = p ? "error" : "success", p && (y.error = p), G--, F(), T(), y.callback && y.callback(p, M), y.state === "success" && (y.params && (delete y.params.UploadData, delete y.params.Body, delete y.params), delete y.callback)), ne());
                }), F(), setTimeout(T);
              }
            }
          }, he = function(y, Q) {
            var p = H[y];
            if (!!p) {
              var M = p && p.state === "waiting", j = p && (p.state === "checking" || p.state === "uploading");
              if (Q === "canceled" && p.state !== "canceled" || Q === "paused" && M || Q === "paused" && j) {
                if (Q === "paused" && p.params.Body && typeof p.params.Body.pipe == "function") {
                  console.error("stream not support pause");
                  return;
                }
                p.state = Q, A.emit("inner-kill-task", {
                  TaskId: y,
                  toState: Q
                });
                try {
                  var K = p && p.params && p.params.UploadData.UploadId;
                } catch {
                }
                Q === "canceled" && K && d.removeUsing(K), F(), j && (G--, W()), Q === "canceled" && (p.params && (delete p.params.UploadData, delete p.params.Body, delete p.params), delete p.callback);
              }
              ne();
            }
          };
          A._addTasks = function(T) {
            S.each(T, function(y) {
              A._addTask(y.api, y.params, y.callback, !0);
            }), F();
          };
          var _ = !0;
          A._addTask = function(T, y, Q, p) {
            y = S.formatParams(T, y);
            var M = S.uuid();
            y.TaskId = M, y.onTaskReady && y.onTaskReady(M), y.TaskReady && (y.TaskReady(M), _ && console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'), _ = !1);
            var j = {
              params: y,
              callback: Q,
              api: T,
              index: B.length,
              id: M,
              Bucket: y.Bucket,
              Region: y.Region,
              Key: y.Key,
              FilePath: y.FilePath || "",
              state: "waiting",
              loaded: 0,
              size: 0,
              speed: 0,
              percent: 0,
              hashPercent: 0,
              error: null,
              _custom: y._custom
            }, K = y.onHashProgress;
            y.onHashProgress = function(w) {
              !A._isRunningTask(j.id) || (j.hashPercent = w.percent, K && K(w), F());
            };
            var oe = y.onProgress;
            return y.onProgress = function(w) {
              !A._isRunningTask(j.id) || (j.state === "checking" && (j.state = "uploading"), j.loaded = w.loaded, j.speed = w.speed, j.percent = w.percent, oe && oe(w), F());
            }, S.getFileSize(T, y, function(w, z) {
              if (w)
                return Q(S.error(w));
              H[M] = j, B.push(j), j.size = z, !p && F(), W(), ne();
            }), M;
          }, A._isRunningTask = function(T) {
            var y = H[T];
            return !!(y && (y.state === "checking" || y.state === "uploading"));
          }, A.getTaskList = function() {
            return S.map(B, N);
          }, A.cancelTask = function(T) {
            he(T, "canceled");
          }, A.pauseTask = function(T) {
            he(T, "paused");
          }, A.restartTask = function(T) {
            var y = H[T];
            y && (y.state === "paused" || y.state === "error") && (y.state = "waiting", F(), X = Math.min(X, y.index), W());
          }, A.isUploadRunning = function() {
            return G || X < B.length;
          };
        };
        r.exports.transferToTaskMethod = k, r.exports.init = P;
      },
      "./src/tracker.js": function(r, i, n) {
        var d = n("./node_modules/@babel/runtime/helpers/classCallCheck.js"), S = n("./node_modules/@babel/runtime/helpers/createClass.js"), a = n("./node_modules/@babel/runtime/helpers/typeof.js"), k = n("./package.json"), P = null, L = function(T) {
          if (!P) {
            var y = n("./lib/beacon.min.js");
            P = new y({
              appkey: "0AND0VEVB24UBGDU",
              versionCode: k.version,
              channelID: "js_sdk",
              openid: "openid",
              unionid: "unid",
              strictMode: !1,
              delay: T,
              sessionDuration: 60 * 1e3
            });
          }
          return P;
        }, A = {
          getUid: function() {
            var T = function() {
              return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
            };
            return T() + T() + "-" + T() + "-" + T() + "-" + T() + "-" + T() + T() + T();
          },
          getNetType: function() {
            if ((typeof navigator > "u" ? "undefined" : a(navigator)) === "object") {
              var T = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
              return (T == null ? void 0 : T.type) || (T == null ? void 0 : T.effectiveType) || "unknown";
            }
            return "unknown";
          },
          getOsType: function() {
            if ((typeof navigator > "u" ? "undefined" : a(navigator)) !== "object")
              return "unknown os";
            var T = navigator.userAgent.toLowerCase(), y = /macintosh|mac os x/i.test(navigator.userAgent);
            return T.indexOf("win32") >= 0 || T.indexOf("wow32") >= 0 ? "win32" : T.indexOf("win64") >= 0 || T.indexOf("wow64") >= 0 ? "win64" : y ? "mac" : "unknown os";
          },
          isMobile: function() {
            var T = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;
            return !!((typeof navigator > "u" ? "undefined" : a(navigator)) === "object" && navigator.userAgent.match(T));
          },
          isAndroid: function() {
            var T = /(Android|Adr|Linux)/i;
            return !!((typeof navigator > "u" ? "undefined" : a(navigator)) === "object" && navigator.userAgent.match(T));
          },
          isIOS: function() {
            var T = /(iPhone|iPod|iPad|iOS)/i;
            return !!((typeof navigator > "u" ? "undefined" : a(navigator)) === "object" && navigator.userAgent.match(T));
          },
          isOtherMobile: function() {
            return isMobile && !isAndroid && !isIOS;
          },
          getDeviceName: function() {
            if ((typeof navigator > "u" ? "undefined" : a(navigator)) !== "object")
              return "unknown device";
            var T = navigator.userAgent.toLowerCase();
            if (T.includes("app/tencent_wemeet"))
              return "tencent_wemeet";
            if (T.indexOf("maxthon") >= 0) {
              var y = T.match(/maxthon\/([\d.]+)/), Q = y && y[1] || "";
              return "\u50B2\u6E38\u6D4F\u89C8\u5668 ".concat(Q).trim();
            }
            if (T.indexOf("qqbrowser") >= 0) {
              var p = T.match(/qqbrowser\/([\d.]+)/), M = p && p[1] || "";
              return "QQ\u6D4F\u89C8\u5668 ".concat(M).trim();
            }
            if (T.indexOf("se 2.x") >= 0)
              return "\u641C\u72D7\u6D4F\u89C8\u5668";
            if (T.indexOf("wxwork") >= 0)
              return "\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668";
            if (T.indexOf("msie") >= 0) {
              var j = T.match(/msie ([\d.]+)/), K = j && j[1] || "";
              return "IE ".concat(K).trim();
            }
            if (T.indexOf("firefox") >= 0) {
              var oe = T.match(/firefox\/([\d.]+)/), w = oe && oe[1] || "";
              return "Firefox ".concat(w).trim();
            }
            if (T.indexOf("chrome") >= 0) {
              var z = T.match(/chrome\/([\d.]+)/), q = z && z[1] || "";
              return "Chrome ".concat(q).trim();
            }
            if (T.indexOf("opera") >= 0) {
              var V = T.match(/opera.([\d.]+)/), Y = V && V[1] || "";
              return "Opera ".concat(Y).trim();
            }
            if (T.indexOf("safari") >= 0) {
              var ie = T.match(/version\/([\d.]+)/), le = ie && ie[1] || "";
              return "Safari ".concat(le).trim();
            }
            if (T.indexOf("edge") >= 0) {
              var ue = T.match(/edge\/([\d.]+)/), ee = ue && ue[1] || "";
              return "edge ".concat(ee).trim();
            }
            return T.substr(0, 200);
          }
        }, B = {
          isMobile: A.isMobile(),
          isBrowser: !A.isMobile(),
          mobileOsType: A.isAndroid() ? "android" : A.isIOS ? "ios" : "other_mobile",
          pcOsType: A.getOsType()
        }, H = {
          deviceType: B.isMobile ? "mobile" : B.isBrowser ? "browser" : "unknown",
          devicePlatform: B.isMobile ? B.mobileOsType : B.pcOsType,
          deviceName: A.getDeviceName()
        }, G = ["multipartInit", "multipartUpload", "multipartComplete", "multipartList", "multipartListPart", "multipartAbort"], X = ["putObject", "postObject", "appendObject", "sliceUploadFile", "uploadFile", "uploadFiles"].concat(G), N = ["getObject"];
        function F(_) {
          return X.includes(_) ? "cos_upload" : N.includes(_) ? "cos_download" : "base_service";
        }
        function ne(_) {
          return _.replace(/([A-Z])/g, "_$1").toLowerCase();
        }
        function W(_) {
          var T = {}, y = ["tracePlatform", "cossdkVersion", "region", "networkType", "host", "accelerate", "requestPath", "size", "httpMd5", "httpSign", "httpFull", "name", "result", "tookTime", "errorNode", "errorCode", "errorMessage", "errorRequestId", "errorStatusCode", "errorServiceName", "errorType", "traceId", "bucket", "appid", "partNumber", "retryTimes", "reqUrl", "customId", "fullError", "deviceType", "devicePlatform", "deviceName"], Q = ["tracePlatform", "cossdkVersion", "region", "bucket", "appid", "networkType", "host", "accelerate", "requestPath", "partNumber", "size", "name", "result", "tookTime", "errorRequestId", "retryTimes", "reqUrl", "customId", "deviceType", "devicePlatform", "deviceName"], p = _.result === "Success" ? Q : y;
          for (var M in _)
            if (!!p.includes(M)) {
              var j = ne(M);
              T[j] = _[M];
            }
          return T;
        }
        var he = /* @__PURE__ */ function() {
          function _(T) {
            d(this, _);
            var y = T.parent, Q = T.traceId, p = T.bucket, M = T.region, j = T.apiName, K = T.fileKey, oe = T.fileSize, w = T.accelerate, z = T.customId, q = T.delay, V = T.deepTracker, Y = p && p.substr(p.lastIndexOf("-") + 1) || "";
            this.parent = y, this.deepTracker = V, this.delay = q, this.params = {
              cossdkVersion: k.version,
              region: M,
              networkType: "",
              host: "",
              accelerate: w ? "Y" : "N",
              requestPath: K || "",
              size: oe || -1,
              httpMd5: 0,
              httpSign: 0,
              httpFull: 0,
              name: j || "",
              result: "",
              tookTime: 0,
              errorNode: "",
              errorCode: "",
              errorMessage: "",
              errorRequestId: "",
              errorStatusCode: 0,
              errorServiceName: "",
              tracePlatform: "cos-js-sdk-v5",
              traceId: Q || A.getUid(),
              bucket: p,
              appid: Y,
              partNumber: 0,
              retryTimes: 0,
              reqUrl: "",
              customId: z || "",
              deviceType: H.deviceType,
              devicePlatform: H.devicePlatform,
              deviceName: H.deviceName,
              md5StartTime: 0,
              md5EndTime: 0,
              signStartTime: 0,
              signEndTime: 0,
              httpStartTime: 0,
              httpEndTime: 0,
              startTime: new Date().getTime(),
              endTime: 0
            }, this.beacon = L(q);
          }
          return S(_, [{
            key: "formatResult",
            value: function(y, Q) {
              var p, M, j, K, oe, w, z = new Date().getTime(), q = z - this.params.startTime, V = A.getNetType(), Y = y ? (y == null ? void 0 : y.code) || (y == null || (p = y.error) === null || p === void 0 ? void 0 : p.code) || (y == null || (M = y.error) === null || M === void 0 ? void 0 : M.Code) : "", ie = y ? (y == null ? void 0 : y.message) || (y == null || (j = y.error) === null || j === void 0 ? void 0 : j.message) || (y == null || (K = y.error) === null || K === void 0 ? void 0 : K.Message) : "", le = y ? (y == null ? void 0 : y.resource) || (y == null || (oe = y.error) === null || oe === void 0 ? void 0 : oe.resource) || (y == null || (w = y.error) === null || w === void 0 ? void 0 : w.Resource) : "", ue = y ? y == null ? void 0 : y.statusCode : Q.statusCode, ee = y ? (y == null ? void 0 : y.headers) && (y == null ? void 0 : y.headers["x-cos-request-id"]) : (Q == null ? void 0 : Q.headers) && (Q == null ? void 0 : Q.headers["x-cos-request-id"]), de = y ? ee ? "Server" : "Client" : "";
              if (Object.assign(this.params, {
                tookTime: q,
                networkType: V,
                httpMd5: this.params.md5EndTime - this.params.md5StartTime,
                httpSign: this.params.signEndTime - this.params.signStartTime,
                httpFull: this.params.httpEndTime - this.params.httpStartTime,
                result: y ? "Fail" : "Success",
                errorType: de,
                errorCode: Y,
                errorStatusCode: ue,
                errorMessage: ie,
                errorServiceName: le,
                errorRequestId: ee
              }), y && (!Y || !ie) && (this.params.fullError = y ? JSON.stringify(y) : ""), this.params.name === "getObject" && (this.params.size = Q ? Q.headers && Q.headers["content-length"] : -1), this.params.reqUrl)
                try {
                  var ae = /^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);
                  this.params.host = ae[2];
                } catch {
                  this.params.host = this.params.reqUrl;
                }
              this.sendEvents();
            }
          }, {
            key: "setParams",
            value: function(y) {
              Object.assign(this.params, y);
            }
          }, {
            key: "sendEvents",
            value: function() {
              if (!(G.includes(this.params.name) && !this.deepTracker)) {
                var y = F(this.params.name), Q = W(this.params);
                this.beacon || (this.beacon = L(this.delay || 5e3)), this.delay === 0 ? this.beacon && this.beacon.onDirectUserAction(y, Q) : this.beacon && this.beacon.onUserAction(y, Q);
              }
            }
          }, {
            key: "generateSubTracker",
            value: function(y) {
              return Object.assign(y, {
                parent: this,
                deepTracker: this.deepTracker,
                traceId: this.params.traceId,
                bucket: this.params.bucket,
                region: this.params.region,
                fileKey: this.params.requestPath,
                customId: this.params.customId,
                delay: this.delay
              }), new _(y);
            }
          }]), _;
        }();
        r.exports = he;
      },
      "./src/util.js": function(r, i, n) {
        (function(d) {
          var S = n("./node_modules/@babel/runtime/helpers/typeof.js"), a = n("./lib/md5.js"), k = n("./lib/crypto.js"), P = n("./lib/xml2json.js"), L = n("./lib/json2xml.js"), A = n("./src/tracker.js");
          function B(se) {
            return encodeURIComponent(se).replace(/!/g, "%21").replace(/'/g, "%27").replace(/\(/g, "%28").replace(/\)/g, "%29").replace(/\*/g, "%2A");
          }
          function H(se, b) {
            var U = [];
            for (var g in se)
              se.hasOwnProperty(g) && U.push(b ? B(g).toLowerCase() : g);
            return U.sort(function(o, c) {
              return o = o.toLowerCase(), c = c.toLowerCase(), o === c ? 0 : o > c ? 1 : -1;
            });
          }
          var G = function(b, U) {
            var g, o, c, u = [], v = H(b);
            for (g = 0; g < v.length; g++)
              o = v[g], c = b[o] === void 0 || b[o] === null ? "" : "" + b[o], o = U ? B(o).toLowerCase() : B(o), c = B(c) || "", u.push(o + "=" + c);
            return u.join("&");
          }, X = ["cache-control", "content-disposition", "content-encoding", "content-length", "content-md5", "expect", "expires", "host", "if-match", "if-modified-since", "if-none-match", "if-unmodified-since", "origin", "range", "transfer-encoding"], N = function(b) {
            var U = {};
            for (var g in b) {
              var o = g.toLowerCase();
              (o.indexOf("x-cos-") > -1 || X.indexOf(o) > -1) && (U[g] = b[g]);
            }
            return U;
          }, F = function(b) {
            b = b || {};
            var U = b.SecretId, g = b.SecretKey, o = b.KeyTime, c = (b.method || b.Method || "get").toLowerCase(), u = w(b.Query || b.params || {}), v = N(w(b.Headers || b.headers || {})), R = b.Key || "", I;
            b.UseRawKey ? I = b.Pathname || b.pathname || "/" + R : (I = b.Pathname || b.pathname || R, I.indexOf("/") !== 0 && (I = "/" + I));
            var Z = b.ForceSignHost !== !1;
            if (!v.Host && !v.host && b.Bucket && b.Region && Z && (v.Host = b.Bucket + ".cos." + b.Region + ".myqcloud.com"), !U)
              throw new Error("missing param SecretId");
            if (!g)
              throw new Error("missing param SecretKey");
            var ge = Math.round(ve(b.SystemClockOffset) / 1e3) - 1, ye = ge, te = b.Expires || b.expires;
            te === void 0 ? ye += 900 : ye += te * 1 || 0;
            var De = "sha1", xe = U, Ne = o || ge + ";" + ye, Fe = o || ge + ";" + ye, Ke = H(v, !0).join(";").toLowerCase(), qe = H(u, !0).join(";").toLowerCase(), Xe = k.HmacSHA1(Fe, g).toString(), Ge = [c, I, Oe.obj2str(u, !0), Oe.obj2str(v, !0), ""].join(`
`), ze = ["sha1", Ne, k.SHA1(Ge).toString(), ""].join(`
`), Ve = k.HmacSHA1(ze, Xe).toString(), We = ["q-sign-algorithm=" + De, "q-ak=" + xe, "q-sign-time=" + Ne, "q-key-time=" + Fe, "q-header-list=" + Ke, "q-url-param-list=" + qe, "q-signature=" + Ve].join("&");
            return We;
          }, ne = function(b, U, g) {
            var o = U / 8, c = b.slice(g, g + o);
            return new Uint8Array(c).reverse(), new {
              8: Uint8Array,
              16: Uint16Array,
              32: Uint32Array
            }[U](c)[0];
          }, W = function(b, U, g, o) {
            var c = b.slice(U, g), u = "";
            return new Uint8Array(c).forEach(function(v) {
              u += String.fromCharCode(v);
            }), o && (u = decodeURIComponent(escape(u))), u;
          }, he = function(b) {
            for (var U = {}, g = W(b), o = {
              records: []
            }; b.byteLength; ) {
              var c = ne(b, 32, 0), u = ne(b, 32, 4), v = c - u - 16, R = 0, I;
              for (b = b.slice(12); R < u; ) {
                var Z = ne(b, 8, R), ge = W(b, R + 1, R + 1 + Z), ye = ne(b, 16, R + Z + 2), te = W(b, R + Z + 4, R + Z + 4 + ye);
                U[ge] = te, R += Z + 4 + ye;
              }
              if (U[":event-type"] === "Records")
                I = W(b, R, R + v, !0), o.records.push(I);
              else if (U[":event-type"] === "Stats")
                I = W(b, R, R + v, !0), o.stats = Oe.xml2json(I).Stats;
              else if (U[":event-type"] === "error") {
                var De = U[":error-code"], xe = U[":error-message"], Ne = new Error(xe);
                Ne.message = xe, Ne.name = Ne.code = De, o.error = Ne;
              }
              b = b.slice(R + v + 4);
            }
            return {
              payload: o.records.join(""),
              body: g
            };
          }, _ = function(b) {
            var U = this.options.CopySourceParser;
            if (U)
              return U(b);
            var g = b.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);
            return g ? {
              Bucket: g[1],
              Region: g[3],
              Key: g[7]
            } : null;
          }, T = function() {
          }, y = function(b) {
            var U = {};
            for (var g in b)
              b.hasOwnProperty(g) && b[g] !== void 0 && b[g] !== null && (U[g] = b[g]);
            return U;
          }, Q = function(b, U) {
            var g, o = new FileReader();
            FileReader.prototype.readAsBinaryString ? (g = FileReader.prototype.readAsBinaryString, o.onload = function() {
              U(this.result);
            }) : FileReader.prototype.readAsArrayBuffer ? g = function(u) {
              var v = "", R = new FileReader();
              R.onload = function(I) {
                for (var Z = new Uint8Array(R.result), ge = Z.byteLength, ye = 0; ye < ge; ye++)
                  v += String.fromCharCode(Z[ye]);
                U(v);
              }, R.readAsArrayBuffer(u);
            } : console.error("FileReader not support readAsBinaryString"), g.call(o, b);
          }, p = function() {
            var se = function(g, o) {
              g = g.split("."), o = o.split(".");
              for (var c = 0; c < o.length; c++)
                if (g[c] !== o[c])
                  return parseInt(g[c]) > parseInt(o[c]) ? 1 : -1;
              return 0;
            }, b = function(g) {
              if (!g)
                return !1;
              var o = (g.match(/Chrome\/([.\d]+)/) || [])[1], c = (g.match(/QBCore\/([.\d]+)/) || [])[1], u = (g.match(/QQBrowser\/([.\d]+)/) || [])[1], v = o && se(o, "53.0.2785.116") < 0 && c && se(c, "3.53.991.400") < 0 && u && se(u, "9.0.2524.400") <= 0 || !1;
              return v;
            };
            return b(typeof navigator < "u" && navigator.userAgent);
          }(), M = function(b, U, g, o, c) {
            var u;
            if (b.slice ? u = b.slice(U, g) : b.mozSlice ? u = b.mozSlice(U, g) : b.webkitSlice && (u = b.webkitSlice(U, g)), o && p) {
              var v = new FileReader();
              v.onload = function(R) {
                u = null, c(new Blob([v.result]));
              }, v.readAsArrayBuffer(u);
            } else
              c(u);
          }, j = function(b, U, g, o) {
            g = g || T, b ? typeof U == "string" ? g(Oe.md5(U, !0)) : Blob && U instanceof Blob ? Oe.getFileMd5(U, function(c, u) {
              g(u);
            }, o) : g() : g();
          }, K = 1024 * 1024, oe = function(b, U, g) {
            var o = b.size, c = 0, u = a.getCtx(), v = function R(I) {
              if (I >= o) {
                var Z = u.digest("hex");
                U(null, Z);
                return;
              }
              var ge = Math.min(o, I + K);
              Oe.fileSlice(b, I, ge, !1, function(ye) {
                Q(ye, function(te) {
                  ye = null, u = u.update(te, !0), c += te.length, te = null, g && g({
                    loaded: c,
                    total: o,
                    percent: Math.round(c / o * 1e4) / 1e4
                  }), R(I + K);
                });
              });
            };
            v(0);
          };
          function w(se) {
            return ue(se, function(b) {
              return S(b) === "object" && b !== null ? w(b) : b;
            });
          }
          function z(se, b, U) {
            return se && b in se ? se[b] : U;
          }
          function q(se, b) {
            return le(b, function(U, g) {
              se[g] = b[g];
            }), se;
          }
          function V(se) {
            return se instanceof Array;
          }
          function Y(se, b) {
            for (var U = !1, g = 0; g < se.length; g++)
              if (b === se[g]) {
                U = !0;
                break;
              }
            return U;
          }
          function ie(se) {
            return V(se) ? se : [se];
          }
          function le(se, b) {
            for (var U in se)
              se.hasOwnProperty(U) && b(se[U], U);
          }
          function ue(se, b) {
            var U = V(se) ? [] : {};
            for (var g in se)
              se.hasOwnProperty(g) && (U[g] = b(se[g], g));
            return U;
          }
          function ee(se, b) {
            var U = V(se), g = U ? [] : {};
            for (var o in se)
              se.hasOwnProperty(o) && b(se[o], o) && (U ? g.push(se[o]) : g[o] = se[o]);
            return g;
          }
          var de = function(b) {
            var U, g, o, c = "";
            for (U = 0, g = b.length / 2; U < g; U++)
              o = parseInt(b[U * 2] + b[U * 2 + 1], 16), c += String.fromCharCode(o);
            return btoa(c);
          }, ae = function() {
            var b = function() {
              return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
            };
            return b() + b() + "-" + b() + "-" + b() + "-" + b() + "-" + b() + b() + b();
          }, Ce = function(b, U) {
            var g = U.Bucket, o = U.Region, c = U.Key, u = this.options.Domain, v = !u || typeof u == "string" && u.indexOf("{Bucket}") > -1, R = !u || typeof u == "string" && u.indexOf("{Region}") > -1;
            if (b.indexOf("Bucket") > -1 || b === "deleteMultipleObject" || b === "multipartList" || b === "listObjectVersions") {
              if (v && !g)
                return "Bucket";
              if (R && !o)
                return "Region";
            } else if (b.indexOf("Object") > -1 || b.indexOf("multipart") > -1 || b === "sliceUploadFile" || b === "abortUploadTask") {
              if (v && !g)
                return "Bucket";
              if (R && !o)
                return "Region";
              if (!c)
                return "Key";
            }
            return !1;
          }, J = function(b, U) {
            if (U = q({}, U), b !== "getAuth" && b !== "getV4Auth" && b !== "getObjectUrl") {
              var g = U.Headers || {};
              if (U && S(U) === "object") {
                (function() {
                  for (var c in U)
                    U.hasOwnProperty(c) && c.indexOf("x-cos-") > -1 && (g[c] = U[c]);
                })();
                var o = {
                  "x-cos-mfa": "MFA",
                  "Content-MD5": "ContentMD5",
                  "Content-Length": "ContentLength",
                  "Content-Type": "ContentType",
                  Expect: "Expect",
                  Expires: "Expires",
                  "Cache-Control": "CacheControl",
                  "Content-Disposition": "ContentDisposition",
                  "Content-Encoding": "ContentEncoding",
                  Range: "Range",
                  "If-Modified-Since": "IfModifiedSince",
                  "If-Unmodified-Since": "IfUnmodifiedSince",
                  "If-Match": "IfMatch",
                  "If-None-Match": "IfNoneMatch",
                  "x-cos-copy-source": "CopySource",
                  "x-cos-copy-source-Range": "CopySourceRange",
                  "x-cos-metadata-directive": "MetadataDirective",
                  "x-cos-copy-source-If-Modified-Since": "CopySourceIfModifiedSince",
                  "x-cos-copy-source-If-Unmodified-Since": "CopySourceIfUnmodifiedSince",
                  "x-cos-copy-source-If-Match": "CopySourceIfMatch",
                  "x-cos-copy-source-If-None-Match": "CopySourceIfNoneMatch",
                  "x-cos-acl": "ACL",
                  "x-cos-grant-read": "GrantRead",
                  "x-cos-grant-write": "GrantWrite",
                  "x-cos-grant-full-control": "GrantFullControl",
                  "x-cos-grant-read-acp": "GrantReadAcp",
                  "x-cos-grant-write-acp": "GrantWriteAcp",
                  "x-cos-storage-class": "StorageClass",
                  "x-cos-traffic-limit": "TrafficLimit",
                  "x-cos-mime-limit": "MimeLimit",
                  "x-cos-server-side-encryption-customer-algorithm": "SSECustomerAlgorithm",
                  "x-cos-server-side-encryption-customer-key": "SSECustomerKey",
                  "x-cos-server-side-encryption-customer-key-MD5": "SSECustomerKeyMD5",
                  "x-cos-server-side-encryption": "ServerSideEncryption",
                  "x-cos-server-side-encryption-cos-kms-key-id": "SSEKMSKeyId",
                  "x-cos-server-side-encryption-context": "SSEContext",
                  "Pic-Operations": "PicOperations"
                };
                Oe.each(o, function(c, u) {
                  U[c] !== void 0 && (g[u] = U[c]);
                }), U.Headers = y(g);
              }
            }
            return U;
          }, re = function(b, U) {
            return function(g, o) {
              var c = this;
              typeof g == "function" && (o = g, g = {}), g = J(b, g);
              var u;
              if (c.options.EnableTracker)
                if (g.calledBySdk === "sliceUploadFile")
                  u = g.tracker && g.tracker.generateSubTracker({
                    apiName: b
                  });
                else if (["uploadFile", "uploadFiles"].includes(b))
                  u = null;
                else {
                  var v = -1;
                  g.Body && (v = typeof g.Body == "string" ? g.Body.length : g.Body.size || g.Body.byteLength || -1), u = new A({
                    bucket: g.Bucket,
                    region: g.Region,
                    apiName: b,
                    fileKey: g.Key,
                    fileSize: v,
                    deepTracker: c.options.DeepTracker,
                    customId: c.options.CustomId,
                    delay: c.options.TrackerDelay
                  });
                }
              g.tracker = u;
              var R = function(xe) {
                return xe && xe.headers && (xe.headers["x-cos-request-id"] && (xe.RequestId = xe.headers["x-cos-request-id"]), xe.headers["x-ci-request-id"] && (xe.RequestId = xe.headers["x-ci-request-id"]), xe.headers["x-cos-version-id"] && (xe.VersionId = xe.headers["x-cos-version-id"]), xe.headers["x-cos-delete-marker"] && (xe.DeleteMarker = xe.headers["x-cos-delete-marker"])), xe;
              }, I = function(xe, Ne) {
                u && u.formatResult(xe, Ne), o && o(R(xe), R(Ne));
              }, Z = function() {
                if (b !== "getService" && b !== "abortUploadTask") {
                  var xe = Ce.call(c, b, g);
                  if (xe)
                    return "missing param " + xe;
                  if (g.Region) {
                    if (c.options.CompatibilityMode) {
                      if (!/^([a-z\d-.]+)$/.test(g.Region))
                        return "Region format error.";
                    } else {
                      if (g.Region.indexOf("cos.") > -1)
                        return 'param Region should not be start with "cos."';
                      if (!/^([a-z\d-]+)$/.test(g.Region))
                        return "Region format error.";
                    }
                    !c.options.CompatibilityMode && g.Region.indexOf("-") === -1 && g.Region !== "yfb" && g.Region !== "default" && g.Region !== "accelerate" && console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224");
                  }
                  if (g.Bucket) {
                    if (!/^([a-z\d-]+)-(\d+)$/.test(g.Bucket))
                      if (g.AppId)
                        g.Bucket = g.Bucket + "-" + g.AppId;
                      else if (c.options.AppId)
                        g.Bucket = g.Bucket + "-" + c.options.AppId;
                      else
                        return 'Bucket should format as "test-1250000000".';
                    g.AppId && (console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'), delete g.AppId);
                  }
                  !c.options.UseRawKey && g.Key && g.Key.substr(0, 1) === "/" && (g.Key = g.Key.substr(1));
                }
              }, ge = Z(), ye = ["getAuth", "getObjectUrl"].includes(b);
              if (typeof Promise == "function" && !ye && !o)
                return new Promise(function(De, xe) {
                  if (o = function(Fe, Ke) {
                    Fe ? xe(Fe) : De(Ke);
                  }, ge)
                    return I(Oe.error(new Error(ge)));
                  U.call(c, g, I);
                });
              if (ge)
                return I(Oe.error(new Error(ge)));
              var te = U.call(c, g, I);
              if (ye)
                return te;
            };
          }, pe = function(b, U) {
            var g = this, o = 0, c = 0, u = Date.now(), v, R;
            function I() {
              if (R = 0, U && typeof U == "function") {
                v = Date.now();
                var Z = Math.max(0, Math.round((c - o) / ((v - u) / 1e3) * 100) / 100) || 0, ge;
                c === 0 && b === 0 ? ge = 1 : ge = Math.floor(c / b * 100) / 100 || 0, u = v, o = c;
                try {
                  U({
                    loaded: c,
                    total: b,
                    speed: Z,
                    percent: ge
                  });
                } catch {
                }
              }
            }
            return function(Z, ge) {
              if (Z && (c = Z.loaded, b = Z.total), ge)
                clearTimeout(R), I();
              else {
                if (R)
                  return;
                R = setTimeout(I, g.options.ProgressInterval);
              }
            };
          }, Se = function(b, U, g) {
            var o;
            if (typeof U.Body == "string" ? U.Body = new Blob([U.Body], {
              type: "text/plain"
            }) : U.Body instanceof ArrayBuffer && (U.Body = new Blob([U.Body])), U.Body && (U.Body instanceof Blob || U.Body.toString() === "[object File]" || U.Body.toString() === "[object Blob]"))
              o = U.Body.size;
            else {
              g(Oe.error(new Error("params body format error, Only allow File|Blob|String.")));
              return;
            }
            U.ContentLength = o, g(null, o);
          }, ve = function(b) {
            return Date.now() + (b || 0);
          }, me = function(b, U) {
            var g = b;
            return b.message = b.message || null, typeof U == "string" ? (b.error = U, b.message = U) : S(U) === "object" && U !== null && (q(b, U), (U.code || U.name) && (b.code = U.code || U.name), U.message && (b.message = U.message), U.stack && (b.stack = U.stack)), typeof Object.defineProperty == "function" && (Object.defineProperty(b, "name", {
              writable: !0,
              enumerable: !1
            }), Object.defineProperty(b, "message", {
              enumerable: !0
            })), b.name = U && U.name || b.name || b.code || "Error", b.code || (b.code = b.name), b.error || (b.error = w(g)), b;
          }, Te = function() {
            return (typeof globalThis > "u" ? "undefined" : S(globalThis)) === "object" && (globalThis.constructor.name === "DedicatedWorkerGlobalScope" || globalThis.FileReaderSync);
          }, Ee = function() {
            return (typeof window > "u" ? "undefined" : S(window)) !== "object" && (typeof d > "u" ? "undefined" : S(d)) === "object" && !0 && !Te();
          }, be = function(b) {
            return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(b);
          }, Ie = function() {
            if ((typeof navigator > "u" ? "undefined" : S(navigator)) !== "object")
              return !1;
            var se = navigator.userAgent, b = !!se.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
            return b;
          }(), Ae = function() {
            return (typeof navigator > "u" ? "undefined" : S(navigator)) !== "object" ? !1 : /\sQQ/i.test(navigator.userAgent);
          }(), Oe = {
            noop: T,
            formatParams: J,
            apiWrapper: re,
            xml2json: P,
            json2xml: L,
            md5: a,
            clearKey: y,
            fileSlice: M,
            getBodyMd5: j,
            getFileMd5: oe,
            b64: de,
            extend: q,
            isArray: V,
            isInArray: Y,
            makeArray: ie,
            each: le,
            map: ue,
            filter: ee,
            clone: w,
            attr: z,
            uuid: ae,
            camSafeUrlEncode: B,
            throttleOnProgress: pe,
            getFileSize: Se,
            getSkewTime: ve,
            error: me,
            obj2str: G,
            getAuth: F,
            parseSelectPayload: he,
            getSourceParams: _,
            isBrowser: !0,
            isNode: Ee,
            isCIHost: be,
            isIOS_QQ: Ie && Ae
          };
          r.exports = Oe;
        }).call(this, n("./node_modules/process/browser.js"));
      }
    });
  });
})(cosJsSdkV5);
const COS = /* @__PURE__ */ getDefaultExportFromCjs(cosJsSdkV5.exports);
let cacheList = [], status = !1;
const defaultBucket = "it-platform-1300554927", defaultRegion = "ap-chengdu";
function getUuid() {
  return v4();
}
function getExt(r) {
  const i = r.split(".");
  return i[i.length - 1];
}
async function getAuthorization(r) {
  if (status)
    return new Promise((i) => {
      cacheList.push((n) => {
        i(n);
      });
    });
  {
    status = !0;
    const i = await r();
    return cacheList.forEach((n) => {
      n(i);
    }), cacheList = [], status = !1, i;
  }
}
class CosUpLoad {
  constructor(i) {
    ht(this, "cos");
    ht(this, "_Bucket");
    ht(this, "_Region");
    if (!i)
      throw new Error("CosUpLoad\u7F3A\u5C11\u914D\u7F6E\u9879");
    this._Bucket = i.bucket || defaultBucket, this._Region = i.region || defaultRegion, this.cos = new COS({
      getAuthorization: async (n, d) => {
        const S = await getAuthorization(i.request);
        d({
          TmpSecretId: S.tmpSecretId,
          TmpSecretKey: S.tmpSecretKey,
          XCosSecurityToken: S.sessionToken,
          StartTime: S.startTime,
          ExpiredTime: S.expiredTime
        });
      }
    });
  }
  upload(i) {
    const n = new Date(), d = n.getFullYear() + "-" + (n.getMonth() + 1), S = i.action + d + "/" + getUuid() + "." + getExt(i.file.name), { data: a, Bucket: k, Region: P } = i.data;
    this.cos.putObject(
      {
        Bucket: a ? k || this._Bucket : this._Bucket,
        Region: a ? P || this._Region : this._Region,
        Key: S,
        Body: i.file,
        onProgress: (L) => {
          L.total > 0 && (L.percent = L.loaded / L.total * 100), i.onProgress(L);
        }
      },
      (L, A) => {
        L ? i.onError(L) : (A.key = S, i.onSuccess(A));
      }
    );
  }
  async getObjectUrl(i, n, d = !0) {
    return await Promise.all(
      n.map((a) => new Promise((k) => {
        this.cos.getObjectUrl(
          {
            Bucket: i.Bucket || this._Bucket,
            Region: i.Region || this._Region,
            Key: a,
            Sign: d
          },
          function(P, L) {
            k(P ? L : L.Url);
          }
        );
      }))
    );
  }
  async getObject(i, n) {
    return await Promise.all(
      n.map((S) => new Promise((a, k) => {
        this.cos.getObject(
          {
            Bucket: i.Bucket || this._Bucket,
            Region: i.Region || this._Region,
            Key: S
          },
          function(P, L) {
            P ? k(P) : a(L);
          }
        );
      }))
    );
  }
  deleteMultipleObject(i, n) {
    return new Promise((d, S) => {
      this.cos.deleteMultipleObject(
        {
          Bucket: i.Bucket || this._Bucket,
          Region: i.Region || this._Region,
          Objects: n.map((a) => ({ Key: a }))
        },
        function(a, k) {
          a ? S(a) : d(k);
        }
      );
    });
  }
  async uploadPiece(i) {
    const n = new Date(), d = n.getFullYear() + "-" + (n.getMonth() + 1), S = i.action + d + "/" + getUuid() + "." + getExt(i.file.name), { data: a, Bucket: k, Region: P } = i.data, L = a ? k || this._Bucket : this._Bucket, A = a ? P || this._Region : this._Region, B = {
      Bucket: L,
      Region: A,
      Key: S,
      Body: i.file
    };
    await this.uploadPiecePart(B, i);
  }
  async uploadPiecePart(i, n) {
    const d = i.Body, S = 1 * 1024 * 1024 * n.maxsize, a = d.size;
    let k = Math.ceil(a / S);
    return a % S != 0 && k++, new Promise((P, L) => {
      this.cos.uploadFile(
        {
          ...i,
          SliceSize: S,
          AsyncLimit: k,
          onTaskReady: function(A) {
          },
          onProgress: function(A) {
          },
          onFileFinish: function(A, B, H) {
            const G = H.Key;
            A ? (n.onError(A), L(A)) : (n.onSuccess(G), P(G));
          }
        },
        function(A, B) {
          A ? L(A) : P(B);
        }
      );
    });
  }
}
const index = { validate, tools, cosUpload: CosUpLoad, sdk: demoSdk };
export {
  index as default
};
